Dnsmasq network-wide settings

Started by Colonel Sheppard, May 21, 2025, 03:28:06 AM

Previous topic - Next topic
Switching over from ISC to Dnsmasq, I'm a little confused on how to apply certain settings (like DNS servers) to all devices on the network instead of applying it to each reservation (host) individually.

Example network:
Entire network range: 10.0.248.1 - 10.0.251.255 (10.0.248.0/22)
Reserved range / static leases: 10.0.248.1 - 10.0.250.254
DHCP range: 10.0.251.1 - 10.0.251.254

Do I just create a DHCP range set to "static" with the starting address of 10.0.248.1 and a second range with start/stop as 10.0.251.1 - 10.0.251.254
(Since the static zone only has the start specified how does it know where the zone ends, is it just the entire network up to the next DHCP range?)

And then add tags to the static zone to apply the settings to all devices with reservations? And the same tags to the DHCP zone to apply the same settings to them as well.
In that case do tags for a specific reservation override range tags? i.e The DHCP range has a tag which sets the DNS server to A.B.C, and I want to override it so a particular device gets the DNS server X.Y.Z



Also if that approach is correct; Something I noticed is that when creating a host with the default values, even when the lease time is left blank, it saves a default value of 86400 to the dhcp-conf file.
dhcp-host=12:34:56:78:9A:BC,10.0.248.10,ExampleHost,86400With this in place, I would assume that I would be unable to change the duration of all leases after creation by changing the Lease time setting in the static zone as the host-specific settings override it with 86400.
This is somewhat annoying as I'd like to be able to change the lease time for all leases (including reservations) without needing to edit every single reservation individually

Would it be worth opening an issue requesting that values not be set if they are not specified (i.e the Lease Time)?

I noted this behavior and desire too soon after dnsmasq with its DHCP offerings was released:

https://forum.opnsense.org/index.php?topic=47150.msg237043#msg237043

I didn't go so far as to open a feature request issue for it though. For now, I've just been doing an export of all my static hosts, doing a mass find and replace for all of the lease time values, and then reimporting that into opnsense. It's not as convenient as being able to do it all from within the opnsense GUI, but it has been working fine for me.