LEDE 17.01 - Multiple instances of dnsmasq not working

Hey,

I have to use different dnsmasq settings for the two interfaces. So I try to start two instances of dnsmasq. Though I believe I configured everything according to the documentation, /etc/init.d/dnsmasq start will only start one instance of dnsmasq.

config dnsmasq 'dns_wan'
        list interface 'wan'
        option bind_dynamic '1'
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option local '/wan/'
        option domain 'wan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option nonwildcard '0'
        # DNS64
        list server '::1#5353'
        # This is important and has to be different from 'dns_lan'
        list server '/custom.tld/x.x.x.x'

config dnsmasq 'dns_lan'
        list interface 'lan'
        list notinterface 'lo'
        option bind_dynamic '1'
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp-lan.leases'
        option resolvfile '/tmp/resolv-lan.conf.auto'
        option nonwildcard '0'
        # DNS64
        list server '::1#5353'

config dhcp 'lan'
        option instance 'lan_dns'
        option interface 'lan'
        option dhcpv6 'server'
        option ra 'server'
        option ra_default '1'
        option ra_management '0'
        option ignore '1'
        list dns '2001:db8:1234::1'

config dhcp 'wan'
        option instance 'wan_dns'
        option interface 'wan'
        option ignore '1'
        option ra 'server'
        option ra_default '1'
        option ra_dns '0'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

logread complains about the port being in use.

failed to create listening socket for port 53: Address in use

Do you see something obvious missing?

Both instances are listening in the same local port for IPv6.

Any reason why you are sticking to 17.01 instead of using a more recent release?

Yes. But they should listen on different interfaces. Even though I set option interface. However, this somehow isn't honored if you also set option nonwildcard '0'. This was the problem. After setting this to '1' it works now.

Yes: 18.06 is too big and power-hungry for my WR841N. I'm using the most current snapshot however and also with some custom backports or updated versions of packages (e.g. odhcpd is built from a newer commit in 2019 to support option ra_dns).

1 Like

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