23.05.3 breaks dnsmasq

I just upgraded to 23.05.3, from 23.05.2, and dnsmasq seems to be broken. I run two instances; one for my primary network and another for my secondary network. My config has worked for years, without any changes. Now, on boot, I get errors like the ones below.

dnsmasq-dhcp[1]: DHCP, sockets bound exclusively to interface eth1.14
dnsmasq[1]: failed to create listening socket for 127.0.0.1: Address in use
procd: Instance dnsmasq::seco s in a crash loop 6 crashes, 0 seconds since last crash

The primary network works fine, because it is first in the config. Below are the relevant parts of my config.

config dnsmasq 'prim'
	option domain 'mydomainhere'
	option local '/mydomainhere/'
	list interface 'prim'

config dhcp 'prim_dhcp'
	option dhcpv4 'server'
	option dhcpv6 'disabled'
	option instance 'prim'
	option interface 'prim'
	option limit '50'
	option start '1'

config dnsmasq 'seco'
	option domain 'home.arpa'
	option local '/home.arpa/'
	list interface 'seco'

config dhcp 'seco_dhcp'
	option dhcpv4 'server'
	option dhcpv6 'disabled'
	option instance 'seco'
	option interface 'seco'
	option limit '50'
	option start '1'

If your router's address is the .1 in whatever subnet you've defined, you need to make sure that the start is not overlapping.

Let's see your complete config though:

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
2 Likes

It will take me some time to get that info. In the mean time, I have some extra details that might provide some clues. I have worked around the problem by disabling DNS for the secondary network (set port to 0) and making DHCP use the Google DNS servers instead. This would indicate both instances were trying to bind to port 53 on 127.0.0.1, which wasn't obvious from those log messages. If I am understanding the DHCP config correctly, nothing should be trying to bind to 127.0.0.1:53, when the interface is specified. Whatever is causing that to occur seems to be the bug.

I have a very similar situation, i just upgraded my openwrt (i am compiling myself so not using a release), and my dhcp config used to work until i built this new version with a new version of dnsmasq.. i also strongly suspect something in the dhcp area has changed.

my errors look like this:

Sun Apr  7 19:16:25 2024 daemon.crit dnsmasq[1]: failed to create listening socket for fe80::5ca4:29a8:207b:fbce%br-lan: Address in use

So they're basically the IPv6 analog to your errors

What i ended up having to do with (at least with this new version of dnsmasq) was add:

       list notinterface 'br-lan'

for every separate instance (each config dnsmasq block).. i already had a list notinterface 'loopback', but now it seems i also need to add that for br-lan (whereas i didn't before). unless something changed elsewhere, i'd point the finger at a dnsmasq config generating having changed, but i don't have the time to look through the git blame to see if i can figure out what did it.

@jaredoconnor try adding: 'list notinterface 'loopback'to your config dnsmasq sections (under thelist interface` lines) ? you'll probably want to skip that though for the primary instance (it's fine for it to listen on loopback on at least one instance, just not multiple ones). if you get the ipv6 errors i got also, you'll also want to add whichever instance in the ipv6 address it refers to.