Dnsmasq might be broken

If it would be the config, odhcpd-full would have the same problem (same source of information) and apart from the udpate to the latest snapshot, my setup was working without any issue, so even the config was not touched. So back to the root of the issue: In the current snapshot, dhcp with DNSMASQ seems to be broken.

How is your tag "known" assigned to that host? According to documentation, the host config only applies if all the tags listed in "match_tag" apply.

According to documentation, there's no "match_tag" section in the odhcpd config, only duid, mac and name. So this could be the reason for odhcpd working: Dnsmasq respects the match_tag and only applies the host config if the tag was assigned earlier and is recognized here, whereas odhcp doesn't know about match_tag and hence doesn't use it as another mandatory filter.

Have you tried using only mac but not duid and not name, only duid but not mac and not name, and only name but not mac and not duid?

Do you really have networks names in all upper case? I don't know if the configuration cares about this, but LuCI usually shows all networks named in all upper case, no matter how they are actually named.


My belief is your dhcp host line isn’t making it into the dnsmasq.conf file for the correct instance in your multi-instance config. Check the files in /var/etc/.

You might need to change:

option instance '2'


option instance 'SERVERS_dns'

But I’ve never tried using multiple instances before. But I don’t see how using '2’ is relevant to the rest of the config.


Spot on!

1 Like

Any luck @dMopp?

Before the latest snapshot it was working like that, yes. Since now it’s broken. Die UI allows me to select the instance and adds the number but didn’t seems to work. Even if I change it back: nope :(. Very weird. Iam giving opnsense a try but there I have a ipv6 RA issue on one interface :face_vomiting:

That seems to be a bug in luci-mod-network then.

It's possible that it should be a name a not an index. My commit that allows you to select dnsmasq instance uses the index of those it was iterating through, since that's what it looks like luci also does - the zero-based index.

OK - so it should be the instance 'name'?

Yes, I think it needs to be val[".name"] instead of index.

1 Like

Can you show some config which works in this way?

I do not use the feature. And the OP was very reluctant to share their complete config. The only reference I have is the link from @trendy above, and studying the filter_dnsmasq() function in dnsmasq.init.

Iam glad to see, the right people where finding the issue :slight_smile: thanks guys !

The snipped from above showing the config entries (2 per each instance )

Here’s another case:

1 Like
  1. MAC Address Randomization: Your issue might be related to MAC address randomization. Please verify if your device is using a randomized MAC address. If so, the static lease configuration in dnsmasq may not apply. You could try disabling MAC address randomization on your device to see if it solves the problem.
  2. dnsmasq Configuration: Since the issue is specifically with dnsmasq's DHCP feature, please double-check the dnsmasq configurations related to DHCP. Ensure that there is no conflicting setting elsewhere that is overriding your static lease configuration. You can examine the logs or use debugging options to get more information.

Please verify these two areas and let us know if you find anything.

I checked both. Iam not using openwrt anymore but I still have the broken instance in my backup. All starts with an upgrade to the latest snapshot. From the logs I can see it’s simply not offering the static lease. Switching over to full odhcpd fixing the issue as well

This is some BS AI or C&P answer, he's kicking in an open door, the same info's already in the thread...

"Check dnsmasq config", no shit Sherlock...

I don't get the problem you are having it all works as it should for me on the latest snapshot.
have multiple Dnsmasq instances and have devices that can attach to different instances and obtain different static leases and they get the correct IP's as specified by the config.

The only issue I have is they are not listed in luci under the instance of the lease they are bound to they are listed in all instances.
The instance is appended to the end of the hostname but only for the first instance, consecutive instances and not appended.

config host
option instance 'kids_dns'
option dns '1'
option ip ''
option mac '58:B1:0F:11:5C:BC'
option name 'charlotte-tab'

config host
option instance 'adults_dns'
option dns '1'
option ip ''
option mac '58:B1:0F:11:5C:BC'
option name 'charlotte-tab'

Did you assign the host lease to the instance through LuCI or manually via the config file? Using LuCI to assign creates the problem with instance numbers instead of instance names.

1 Like

Made a PR to address this bug.

FAO: @jow @hnyman

1 Like

Yes I set this up via config file manually and specified instance names my self, at the time LUCI could not handle multiple instances well.