OpenWRT: persistent DNS entries

One wrinkle with OpenWRT: if the router reboots, it loses the DNS entries it was giving based on DHCP leases. Even the ones you’ve configured as static DHCP leases, they don’t show up until the client host renews its DHCP lease. Forum discussion suggests this is because dnsmasq is reading from the dhcp.leases file which is stored on tmpfs, not permanent storage.

The simple workaround is just to manually add the host in /etc/hosts and restart dnsmasq. It will serve those entries to DNS clients. That means the client’s IP address is now stored in two different places, which is not ideal, but I can live with it. There’s some discussion of other solutions for this like moving the DHCP lease file to permanent storage or changing the configuration tool to manage parallel entries in both DHCP and dnsmasq. As of 15.05, none of that seems to be happening.

I’m liking OpenWRT now. It’s comforting working with a router that’s a full and proper Linux distribution. It’s also sort of overkill, but on the balance I like it.

One thought on “OpenWRT: persistent DNS entries

  1. Ubiquiti does sell some decent SoHo “enterprise” level gear. The ER-Lite router and their WAPs are all highly rated. Could be a safer bet integrating their gear rather than flashing consumer stuff though will cost a little bit more.

Comments are closed.