DNSmasq DNS & DHCP: Devices assigned to Hosts list but still got other IP

Started by ohlalayeah, October 07, 2026, 05:14:52 AM

Previous topic - Next topic
I have installed OPNsense on my miniPC recently. The version should be 26.7.x.

The DNSmasq DNS & DHCP is working on assigning IP address to the devices on my network via DHCP. However, some devices have been assigned statis IPs using their MAC addresses and have been added to the "Hosts" list but when I configure them to obtain IP address via DHCP, they got assigned dynamic IP addresses within the DHCP range.

Devices which are supposed to be assigned static IP addresses ranged from 192.168.1.3 to 192.168.1.5x.
DHCP range has been set from 192.168.1.3 to 192.168.1.245.

to supplement, some devices could obtain the static IPs from the Hosts list, some obtained the dynamic IPs such as TP-link network switch and an IPcam. dunno why.

Please help me resolve the issue. Otherwise, please provide a step by step tutorial on how to configure DNSmasq DHCP server.  Thank you.

Anyone here?

Quote from: ohlalayeah on October 07, 2026, 05:14:52 AMDevices which are supposed to be assigned static IP addresses ranged from 192.168.1.3 to 192.168.1.5x.
DHCP range has been set from 192.168.1.3 to 192.168.1.245.
Well... at least that part is good :)

QuoteSome devices could obtain the static IPs from the Hosts list, some obtained the dynamic IPs such as TP-link network switch and an IPcam. dunno why.
Could be because of the fact that you can not do a DHCP IP Release on those last two devices ?!

And just to be sure : You did click APPLY after making all the Static DHCP IP Address Mappings ?
I forgot a couple days ago while changing some stuff... It was really awkward! :)



By the way :
I would always configure all important devices on the network with a Static IP Address in their own Operating System or some kind of webGUI and consider the Static DHCP IP Address Mapping as the backup option in case the device somehow loses it's configuration !!

So stuff like :
- Routers
- Switches
- Accesspoints
- Any kind of Servers like NAS devices or DNS Filtering instances either VM/Container based (Proxmox!) or Bare metal ones.
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Quote from: ohlalayeah on October 07, 2026, 05:14:52 AMDevices which are supposed to be assigned static IP addresses ranged from 192.168.1.3 to 192.168.1.5x.
DHCP range has been set from 192.168.1.3 to 192.168.1.245.
I have all my static mappings outside of the DHCP ranges. IP assignments works without any issues with this.

I know, this is not really recommended according to the docs, but I had it this way before in ISC and just configured it the same way as I migrated to Dnsmasq DNS & DHCP.

Quote from: viragomann on October 07, 2026, 09:58:08 PMI have all my static mappings outside of the DHCP ranges. IP assignments works without any issues with this.

I know, this is not really recommended according to the docs, but I had it this way before in ISC and just configured it the same way as I migrated to Dnsmasq DNS & DHCP.
LOL! That makes things even weirder now...

So let's see what https://dnsmasq.org/docs/dnsmasq-man.html has to say :
Quote-G, --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]

-snip-
Addresses allocated like this are not constrained to be in the range given by the --dhcp-range option, but they must be in the same subnet as some valid dhcp-range.
For subnets which don't need a pool of dynamically allocated addresses, use the "static" keyword in the --dhcp-range declaration.
-snip-
I guess you can use both now ?!
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Generally, there are usually one of these problems (not all with all DHCP servers, but hey):

1. With some servers (at least ISC), the creation of a static reservation does not get active unless the service is restarted.
2. Some servers (also ISC), you should not have static reservations within dynamic ranges.
3. When you let a client get a dynamic reservation and convert it to a static one, the dynamic reservation is not deleted, such that a reboot still gives the old IP. You have to manually clean the dynamic reservation from the lease file (and restart the service to recognize that fact).
4. With newer services, a DUID ist being used instead of a MAC (unless you change that setting) - which may give the impression that static reservations (for the MAC) do not work.

That being said, I know that is not an exact answer, just because I happen to use Kea and not DNSmasq.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, Leox LXT-010H-D

1100 down / 450 up, Bufferbloat A+