On 2017-06-22, Jiri B <ji...@devio.us> wrote: > On Thu, Jun 22, 2017 at 11:47:03AM +0200, Andreas Kusalananda Khri wrote: >> >> 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? > > OpenBSD dhcpd cannot do this by itself but ISC dhcpd from ports can > execute whatever on commiting a lease, see > > http://jpmens.net/2011/07/06/execute-a-script-when-isc-dhcp-hands-out-a-new-lease/ > > Though you could parse logs of OpenBSD dhcpd log, maybe good opportunity to > play with various logs "parsers".
Yes that would be possible by parsing logs (should be simpler than parsing leases). Probably better not to reload unbound, you'll lose cache - to avoid that you can use unbound-control's "local_data" and "local_data_remove" commands, or you can write to a local zone file served by NSD and point unbound at that.