How to remove old IP entry of host [solved]
-
Hi,
I have a mailserver. It has an entry in the DNS Resolver "mailserver" and the corresponding IP address 192.168.6.2. But in earlier times it had the IP 192.168.2.2 and this address is some where stored in the system. This is not desirable for me, because when I ping the host via
ping mailserver
the pfsense uses the old IP 192.168.2.2.
So to find something out I did a short
grep -rnw "192.168.2.2" /
and found
/var/unbound/host_entries.conf:12:local-data-ptr: "192.168.2.2 mailserver.localdomain" /var/unbound/host_entries.conf:13:local-data: "mailserver.localdomain. A 192.168.2.2"
I also found out that in the /etc/hosts also contains the old address
192.168.2.2 mailserver.localdomain mailserver
But when I delete the entries in both files, after restarting the DNS Resolvers they are back as nothing happened.
How can I get rid of these entries?Best regards
-
@kalle13 said in How to remove old IP entry of host:
But when I delete the entries in both files, after restarting the DNS Resolvers they are back as nothing happened.
The '/etc/hosts' file is created and re generated by the pfSense GUI. This happens, among others, when the resolver is restarted.
The pfSense GUI knows only about "192.168.2.2 = mailserver" because you told it ;)Look here Services > DNS Resolver > General Settings at the bottom of the page.
Check also Services > DHCP Server > (any LAN) at the bottom of the page : "DHCP Static Mappings for this Interface" -
@gertjan said in How to remove old IP entry of host:
Look here Services > DNS Resolver > General Settings at the bottom of the page.
Check also Services > DHCP Server > (any LAN) at the bottom of the page : "DHCP Static Mappings for this Interface"Thanks for the hint with the DCHP server. I totally forgot about it. I looked in both and found that there is a static DHCP lease in the DCHP server list. But it is shown no where else in the DCHP server and so I couldn't delete it. Then I remembered that this old IP is the an IP of the range of an old now disabled interface. Luckily I only disabled the interface and not deleted it. So I enabled it which created a tab in the DCHP Server menu with this interface and the static mapping of the old IP. I removed it, disabled the interface again and now I am happy!
Solved!