@latency0ms said in Name resolution issue with static IP, DHCP Static Mapping works:
(even though there are quite a few posts on this)
Ok, a quicky :
The DHCP server maintains a file on disk with outstanding an outdated leases.
See it here : /var/dhcpd/var/db/dhcpd6.leases : a small file with an extremely readable content.
When you check this box :
a13f3a6c-d832-4f4a-9a3c-f7daaca2ee5b-image.png
It does not interact with unbound, the Resolver. Neither with the" dhcpd" daemon, the dhpc server for one or more LAN's.
Checking this box launches another program that keeps on running - another daemon.
I'll check the box or a minute so I can show it to you :
[2.5.1-RELEASE][admin@pfsense.my-networkl.net]/root: ps ax | grep leases
....
89854 - Ss 0:00.00 /usr/local/sbin/dhcpleases -l /var/dhcpd/var/db/dhcpd.leases -d my-network.net -p /var/run/unbound.pid -u /var/unbound/dhcpleases_entries.conf -h /etc/hosts
....
And to see what it does, well ..... here it is https://github.com/pfsense/FreeBSD-ports/blob/devel/sysutils/dhcpleases/files/dhcpleases.c
Look at the program - it's open source so a click opens the source and you can read it.
I'll recap :
It puts a 'watch' on the /var/dhcpd/var/db/dhcpd.leases file. When it changes (because a new lease came in, and the dhcpd server updates the file), the daemon dhcpleases reads it, reads the host file, and writes it to /var/unbound/dhcpleases_entries.conf. unbound reads this file when it starts. Open it to see what's in it ^^
Finally, the process dhcpleases restart unbound.
Cool, right ?
Depends.
It restarts unbound on every new or renewed DHCP lease.
You have one PC ? => No big deal.
You have 8 LAN's and 6000 devices ? => unbound gets chain gunned.
Example : you bought this nice home automation thingy device on AliExpress - let's say : your new your door bell with web cam . It asks a new lease every 60 seconds (because it looses its wifi radio signal, reconnects, launches a DHCP request and again and again). And unbound gets restart every 60 seconds. People wind up posting here to ask "why".