On 06/22/17 05:47, Andreas Kusalananda Kähäri wrote: > Hi, > > I have unbound(8) and dhcpd(8) running on a router (OpenBSD 6.1-stable). > dhcpd currently hands out fixed addresses to my clients, but I'd like > these to be allocated dynamically from the common pool, while at the > same time being resolvable. > > Is there an existing solution for feeding the IP-addresses of the leases > that dhcpd hands out into the unbound configuration and reload it, or > would I have to write a script that parses the lease declarations in > /var/db/dhcpd.leases? > > I know about dnsmasq in ports which I believe serves as both DHCP and > DNS server, but I'd rather use the software in the base system if at all > possible.
http://www.thismetalsky.org/projects/dhcp_dns This is abandonware, but it works really slick -- ran it on a Sparc20 I used as DHCP/DNS server for probably close to ten years. Problem is, it was for DJBDNS, not nsd(8)/BIND zone files. But, I had little trouble adapting it to create nsd(8)-compatible zone files. I'm not going to show my code because there are a few things that are too much "hey, it worked!" and not really done as they should be, but it parses the dhcpd.leases file very well and outputs good data...just a matter of dropping it in the desired formats and telling nsd to reload its data. Nick.