OpenWrt: Unreliable local domain resolution

I am using OpenWrt CHAOS CALMER (15.05.1, r48532) on my Linksys WRT1200AC router.

I have set up local domain "lan" in the DHCP and DNS settings (referring to LuCI Network / DHCP and DNS page). In expectation that the client domain names will be resolved from [hostname]/lan.

And it works, .. sort of. After starting up my system (Ubuntu 16.04), I struggle to get other-pc.lan resolved, for several attempts. And then, suddenly it gets resolved and there's no problem for some time. And the problem repeats for another-pc.lan.

At the client side, for my WiFi network connection, I use Google's 8.8.8.8 for DNS server. Perhaps I should change something in my client network config, to direct DNS resolution to the local router, in case of *.lan domains?

basically this. google does not know about your .lan hosts.
idk why it works sometimes, but your clients have to use your local cache/resolver for this to work.

you may tell your router to forward requests to google-dns if you think this is neccessary.

2 Likes

That's an ancient release, full with known security vulnerabilities that have been patched in the mean time. Please run the latest 17.01.4 release for just the sake of your router's and network's security. Hopefully, this also fixes the issues you are experiencing, since many bugs have been squashed.

You can upgrade by flashing the sysupgrade image for your router. Make sure you don't "keep settings", since config files have changed from Chaos Calmer. You will have to configure your router anew.

When you reboot the router, the DHCP table in /tmp/dhcp.leases is deleted (everything in /tmp is in RAM) and local DNS will not work until the client in question has renewed their lease.

Your PC should be set to use only the router for DNS. The router will forward the request to the WAN DNS if it is external. This is the default if the PC is set for a DHCP-only configuration.

2 Likes