Configuring Dnsmasq for 2 instances

Hi all, newbie to OpenWrt converting across from DDWRT which I've used for years and am stumped as to why I can't get my 2 instances of dnsmasq working in harmony. I have read the documentation backward and forward and still not getting it right.

Here's my scenario:

Background, need a second set of devices on the network to have seperate dns servers and I want to use dnsmasq for it so I get logging and as well as can operate specific requests with server statements in the seperate file seen in configs below.

I can successfully setup the dns aspect, the 2nd instance I put on port 54 and thus for dns there's no conflict and I get the other clients redirected with a firewal rule. DNS is a-ok and resolving on both instances just fine.

The issue I have is that I cannot seem to stop DHCP for the 2nd instance, so I'm clearly doing something wrong, below is an example of my dhcp config file. If I set the dhcp option to 'disabled' on the 2nd instance it also stops dhcp on the first instance. If I leave it as 'server' it of course conflicts with the first instance and is trying to give out dhcp leases causing network chaos.

Would be grateful for any direction. I'm trying to keep things simple and this seemed to be the cleanest route to go.

config dnsmasq 'lan'
option domainneeded '1'
option localise_queries '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option sequential_ip '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option serversfile '/etc/noads.split.servers'
option localservice '1'
option ednspacket_max '1232'
option rebind_protection '1'
option logqueries '1'
option noresolv '1'
list server '1.0.0.3'
list server '1.1.1.3'

config dnsmasq 'smart_dns'
option domainneeded '1'
option localise_queries '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '0'
option readethers '1'
option localservice '1'
option leasefile '/tmp/dhcp.leases'
option ednspacket_max '1232'
option rebind_protection '1'
option logqueries '1'
option serversfile '/etc/noads.split.servers'
option strictorder '1'
option port '54'
option noresolv '1'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
list server 'x.x.x.x'
list server 'x.x.x.x'
list server 'x.x.x.x'

config dhcp 'lan'
option interface 'lan'
option start '100'
option dhcpv4 'server'
option ra_slaac '1'
option force '1'
option dhcpv6 'disabled'
option ra 'disabled'
option ignore '0'
option limit '92'
option leasetime '720m'

config dhcp 'smart_dns'
option instance 'smart_dns'
option interface 'smart_dns'
option dhcpv4 'disabled'
option ra_slaac '1'
option force '1'
option dhcpv6 'disabled'
option ra 'disabled'
option ignore '0'

Set the instance name (lan) in the lan DHCP pool section in order to bind the pool to this instance only. Set option ignore '1' in the smart_dns DHCP pool section.

Wanted to share I've managed to fix this, appreciate the input, that helped. I encountered a problem starting dnsmasq when I called the instance 'lan', once I called it something else and adapted accordingly the changes you suggested supported all springing to life without issue. Thanks

1 Like