Can I steer hosts to a particular DNSMasq DHCP range

Started by endurium, May 20, 2026, 12:41:57 PM

Previous topic - Next topic
May 20, 2026, 12:41:57 PM Last Edit: May 20, 2026, 06:51:48 PM by endurium
Hi all,

Is there a way to "direct" a host to get it's IP address from a specific DNSMasq address pool (DHCP range)?  I want all hosts within that pool to use ADguard DNS so I've tried tagging a host entry with an "dnsfilter" tag and have also tagged the desired pool with the same tag, but it doesn't seem to work in that the host gets it's dynamic IP from the pool that's tagged "static".
I'm guessing my understanding of tags in DNSMasq is very much lacking so I'm looking for some guidance from the experts in this forum.
TIA
Intel N100 | 6*I226-V | 32GB DDR5 | 512GB NVME | Proxmox 9

Quote from: endurium on May 20, 2026, 12:41:57 PMIs there a way to "direct" a host to get it's IP address from a specific DNSMasq address pool (DHCP range)?
Can't you just use 'Static DHCP Mappings based on the MAC Address' for those hosts with the specific 'DNS Server IP Address' configured in the mapping ?!
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Normally, that would be a scenario for VLANs and different subnets, not ranges.

When you use static mappings for affected clients, you might as well send a specific DNS server IP with the DHCP option response that is different from the default. So strictly speaking, there does not even have to be a "range" for this purpose.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 450 up, Bufferbloat A+

Quote from: meyergru on Today at 12:44:25 AMNormally, that would be a scenario for VLANs and different subnets, not ranges.

When you use static mappings for affected clients, you might as well send a specific DNS server IP with the DHCP option response that is different from the default. So strictly speaking, there does not even have to be a "range" for this purpose.

You're correct, I was trying to avoid specifying an IP address for the static mapping, thinking that by tagging the static mapping it would direct the host to get it's IP from the first pool or range matching that tag, but it just gets it's address from the lowest range.

In ISCv4 I can direct hosts to a particular address pool using MAC address matching so I'd (wrongly) presumed that tags were the DNSMasq way of achieving the same thing.

Which begs the question: what is the point of having more than one DHCP range for an interface?  If I ask Copilot AI, the answer is:
QuoteIn OPNsense's dnsmasq, DHCP ranges exist so dnsmasq can hand out IP addresses — and you can optionally segment those ranges using tags. 
If you don't use tags, the ranges are just "where DHCP leases come from".
If you do use tags, ranges become "pools" that only tagged clients can enter.

But I've found that's not the case.
Intel N100 | 6*I226-V | 32GB DDR5 | 512GB NVME | Proxmox 9

Quote from: nero355 on Today at 12:15:37 AM
Quote from: endurium on May 20, 2026, 12:41:57 PMIs there a way to "direct" a host to get it's IP address from a specific DNSMasq address pool (DHCP range)?
Can't you just use 'Static DHCP Mappings based on the MAC Address' for those hosts with the specific 'DNS Server IP Address' configured in the mapping ?!
I can do that but I was hoping to leave the selection of the IP address to DNSMasq from a specified address pool/range rather than having to decide on the IP address myself, but it looks to me like there's no point having more than one DHCP range, so I define the desired hosts as static with fixed IPs and tag them, then use DHCP option dns-server[6] to specify the Adguard DNS server address.
Intel N100 | 6*I226-V | 32GB DDR5 | 512GB NVME | Proxmox 9

I created a firewall alias for both vlans.  limiting the number of devices that can use that vlan.

then firewall rules for which gateway for traffic.


the remaining devices have static reservations (this sounds like more work for you).  depending on the number of devices you have

I then use Kea (I'm sure dnsmasq can do the same)and under subnet uncheck Auto collect option data.   and manually put in the dns servers for the devices I want to change the DNS servers on. 

hopefully I understood your correctly


DEC740 > USW-Pro-8-PoE> U6-Enterprise
Dec670. Retired / backup device