Unbound seemingly never removes stale DHCP records

Started by bubbagump, March 15, 2022, 02:14:34 PM

Previous topic - Next topic
March 15, 2022, 02:14:34 PM Last Edit: March 15, 2022, 03:03:09 PM by bubbagump
Running 22.1.2_1. Seemingly Unbound never deletes/cleans up A records created by DHCP. As an example and how I can reproduce it - I spin up a new VM and it uses DHCP in its initial boot. Once it boots the first time, I create a static reservation and refresh the lease on the VM to use the new IP reservation. Now Unbound reports the original IP and the new reservation IP. Fast forward a few days and the original DHCP lease which has long expired literally days ago is still being served by Unbound along with the reservation IP. No amount of service restarts or reboots cleans it up. Is this a bug? By design and I am missing a config option? Something else?

EDIT: Ignore me... somehow the default lease time was set to a WEEK. Well, that explains that. It was a DHCP issue and not Unbound as when I deleted the entries from /var/unbound/dhcpleases.conf, they would reappear when I restarted Unbound. That was my clue. I r dum.

what is your TTL for Host cache entries ?

(Time to live for entries in the host cache. The host cache contains roundtrip timing and EDNS support information. The default is 15 minutes. )

Thank you, but see my edit above... somehow the DHCP lease time was set to a week. (I think I know how this happened - someone trying to match Windows DHCP defaults... grumble.)

Did you know: the reference file for Unbound's DHCP watcher is /var/dhcpd/var/db/dhcpd.leases and this is operated by DHCPd alone. Of course you can edit the file yourself if you really need to purge a lease although it might not convince the client to give it up either.  :)


Cheers,
Franco

Thanks, yup, I tracked that down and see how the plumbing connects now.