[SOLVED] ISC DHCPv4 not writing static addresses to /var/dhcpd/var/db/dhcpd.leases

Started by Double K, May 08, 2025, 05:12:59 PM

Previous topic - Next topic
OPNsense 25.1.5_5-amd64

I'm new to OPNsense - first time setup.
I've used the other one for 10+ years, but I'm moving to new hardware.

My overall issue is that static mappings aren't registering in Unbound from ISC DHCPv4.  Dynamic leases are working.
Services: Unbound DNS: General
- Register ISC DHCP4 Leases: Checked/Enabled
- Register DHCP Static Mappings: Checked/Enabled

In another post, Franco mentions that the mappings need to be in /var/dhcpd/var/db/dhcpd.leases for them to show up in unbound.
In my case, they are not showing up in that file.  Only the dynamic leases are.
However, in the GUI, the static assignments are showing in Services: ISC DHCPv4: Leases (along with the dynamic leases)

The static assignments are in /var/dhcpd/etc/dhcpd.conf

How do I get ISC DHCPv4 to write the static assignments to the file that unbound needs them in? (I've tried restarting the services, and rebooting)


Services > Unbound DNS > General > Register DHCP Static Mappings [X]
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Well, assuming that was already checked as described the obvious issue is that the static mapping must have an IP address and a hostname.


Cheers,
Franco

Thanks, yes that is checked and yes they do have Hostnames & IP Addresses.

You know you have to restart Unbound to activate any static leases you might have added/changed since the last restart?

Introduced in 24.7.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Doesn't Unbound have to be restarted to pick up static leases? [Patrick beat me to this part]

And given the state of the 2 files mentioned in this thread, I suspect it goes to the source directly (file in etc).

Thanks guys.

I do now :-) I can feel your head shaking lol. Thanks for the link!

Pasting here from the link if anyone else finds this in search;
ISC DHCP will no longer reload DNS services on static mapping edits. This is for feature parity with Kea DHCP and avoiding cross-service complications. If you expect your static mappings to show up in a particular DNS service please restart this service manually.

(I also went to System - Firmware - Packages, and reinstalled isc-dhcp44-server to see if that would fix it).

Works now.

To help others, could I request that this be added to the manual?  Either on the ISC DHCP page and/or the Unbound page under Register ISC DHCP Static Mappings -
Register static dhcpd entries so clients can resolve them. Supported on IPv4 and IPv6. +Requires service restart on each static mapping edit.

Thanks again guys, will mark this as Solved.

Maybe the best thing would be to add it to the checkbox help of Unbound and Dnsmasq register static lease options since these services are the consumers of the static mappings, but not directly tied to them. Open for PRs on GitHub.


Cheers,
Franco