Clearing DNS records created by DHCP



  • I created a new machine which got an IP address through DHCP. Pfsense is configured to register these to DNS.

    I then gave the new machine a static IP address and added that to DNS then removed the DHCP lease from Pfsense but can’t find the DNS record anywhere.

    I get both the new and old IP addresses from nslookup from multiple machines. How can remove the old DNS records created by the DHCP service?



  • Are you sure the old IP address isn’t being cached on each client?



  • @KOM:

    Are you sure the old IP address isn’t being cached on each client?

    If it is in the DNS cache, it should be deleted after a period of time.  Regardless, it’s possible to flush the cache.



  • @KOM:

    Are you sure the old IP address isn’t being cached on each client?

    I get the same results from different machines. Including Linux machines which don’t have a DNS cache


  • Rebel Alliance

    And your using unbound, the forwarder?  What?  Was this client a static dhcp reservation before… Did you remove the reservation off pfsense?



  • @johnpoz:

    And your using unbound, the forwarder?  What?  Was this client a static dhcp reservation before… Did you remove the reservation off pfsense?

    Using unbound. The old IP address wasn’t static, it was assigned by the DHCP server. I removed the DHCP lease. A static mapping wasn’t configured


  • Rebel Alliance

    Ok look in
    dhcpleases_entries.conf

    Or
    host_entries.conf

    in /var/unbound do you see this old entry?



  • @johnpoz:

    Ok look in
    dhcpleases_entries.conf

    Or
    host_entries.conf

    in /var/unbound do you see this old entry?

    Yes I can see the old IP address in dhcpleases_entries.conf and the new one in host_entries.conf.


  • Rebel Alliance

    well remove it from dhcpleases._entries.conf

    You stated you had removed the old lease - if so it should of been removed from there when you did that.



  • @johnpoz:

    well remove it from dhcpleases._entries.conf

    You stated you had removed the old lease - if so it should of been removed from there when you did that.

    I removed it from dhcpleases._entries.conf. Does anything need restarting for the changes to take effect? I still get the old IP from nslookup



  • This is working now. Just had to give it some time it seems


  • Rebel Alliance

    well you would need to clear the cache on dns server, and or clients local copy which would time out after the ttl expired which most likely would of been at most 1 hour.


 

© Copyright 2002 - 2018 Rubicon Communications, LLC | Privacy Policy