Static lease dnsmasq instance bugs?

Hi

I have set up multiple instances of dnsmasq (Kids_dns and Adults_dns) but when I go into the section dhcp and dns in luci the static leases listed under on both instances.

It is just weird it lists a static lease for an interface that is not even in the Ip address range of the dhcp pool for that instance.

Under kids dns instance I have a static lease of 192.168.2.1 for and the pool is 192.168.2.0/24
under Adults dns instance I have the same lease listed of 192.168.2.1 and the pool is 192.168.1.0/24

I have not tried it but if i were to create a static lease for a device in the host section for each instance with differing static ip adresses but he host and the mac being the same would this cause an issue ? example below

config host
	option dns '1'
	option name 'taynepc'
	option mac '34:41:5D:0A:52:2B'
	option ip '192.168.2.167'

config host
	option dns '1'
	option name 'taynepc'
	option mac '34:41:5D:0A:52:2B'
	option ip '192.168.1.167'

I would guess it should only list the lease in the correct instance is this just a bug?

I see i have the option to set in the host section (instance) to bind the lease to an instance but it still shows up in luci as leases in both instances.
The option to set the lease to a specific instance does not apear in Luci and it looks like i can only configure this via config editing..

also there seems to be a bug that all the dhcp pool lease data is only displayed in the first instance when devices are connected to both pools and again lists devices in an incorect pool in that instance outside of that instances dhcp pool range.

is this below the correct way to bind a lease to an instance ?

config host
	option dns '1'
	option name 'taynepc'
	option mac '34:41:5D:0A:52:2B'
	option ip '192.168.2.167'
        option instance 'Kids_Dns'

config host
	option dns '1'
	option name 'taynepc'
	option mac '34:41:5D:0A:52:2B'
	option ip '192.168.1.167'
        option instance 'Adults_Dns'

LuCI does not fully support multiple dnsmasq instances. If you use them, ui behavior is undefined.

3 Likes

Ok thanks I was thinking I had something set wrong or it was not using a second instance of dnsmasq.

For me this was indeed the solution to bind a lease to a specific instance, thanks!

option instance '<DOMAIN>_dns'

I had to run the following to have the settings being applied ofcourse:

uci commit dhcp
service dnsmasq restart

This post is rather old, but maybe it can help others (adblock per instance): Adblock for specific devices, tutorial to create multiple dnsmasq instances? - #10 by dibdot

I`m running AdGuardHome as an ad blocker service. I defined rules per subnet so every instance has its own set of block lists/rules and different upstream DNS servers. Working like a charm!

1 Like

Yes it will bind to a seperate instance but luci is unable to define and list leases in a specific instance from the UI.

It omits the domain when configuring leases nomater which instance the lease is defined in under luci, manual intervention is required by altering config elements.

I use adblock and have a kids an adults network, but manual scripting would be required to provide different sets of rules on different instances, I'd be intrested in how you implement this, and the same for Banip how i would bind that to a specific interface as that seems to be system wide.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.