Suddenly my DNS configuration failed?

Hey there I have an WRT3200ACM that has been running OpenWRT for years now. I have updated OpenWRT a few times on it and am at 19.07.

So this is setup as a pretty standard AP that is directly connected to WAN and I haven't changed any settings on it for months and months. But suddenly yesterday the internet was not working. I rebooted my router and my modem and it didn't do anything (always worth a shot). I did a quick check and figured out it was the DNS. I could ping 8.8.8.8 but no webpages were loading.

So I ended up setting up dns forwarding in LUCI to be

  1. 8.8.8.8

That got everything working. However I later remembered that I have a few things on my local network that I can no longer access any more.

So it really seems strange to me that suddenly my DNS config broke. But what I really want to figure out is how to get it working again.

Here is my config

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

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

Do those few things get their own IP addresses via DHCP, or are they configured with static addresses?

If they get their IP addresses via DHCP, dnsmasq won't update its cache with their hostnames until they renew their leases.

If they've got static IP addresses, check that you've got entries for each of them in a file accessible to and used by dnsmasq.

1 Like

You can lower the dhcp leasetime to force the hosts to update more often in such cases.

2 Likes

Yeah that's not the problem. I have a /etc/hosts and /etc/ethers file which I have used for some time. It's not anything I have changed in recent months. Are you implying it's not using those files any longer or something?

Good point. I can see option readethers '1' and I can't see option nohosts '1', so it ought to be using those files.

1 Like