DNS Fallback Address

Is there a way to configure a fallback DNS server address in OpenWRT for occasions when my ISP's DNS servers go offline ?

So if no answer is available from the DNS address provided with the DHCP lease, then the DNS at the fallback address can be used.


If the DNS servers of your ISP tend to go offline too often, then you'd better use some other DNS like Cloudflare, GoogleDNS etc.
Read the NS provided by your ISP: head -n -0 /tmp/resolv.*
Then on the wan interface, tick to use your own NS and add the ISP NS as well as


Thanks, but that's not what I want to do.

I want the primary DNS address to come from the ISP normally (automatically) in the DHCP lease. I want to know if it is possible to add (manually) a fallback DNS address, that would be used if the primary DNS server is unavailable. Manually configuring all DNS seems like a retrograde step.


Your ISP will most likely not change the NS IP address.
There are usually 2 NS from the ISP.
You can add more of them in other interfaces, lan for example, but it is not that correct and there is no guarantee that the order will be the one you want.

Weight the previous statements and decide which is best for you.

While you can configure multiple IP addresses for DNS servers, they're not used in a fallback configuration but accessed in a round-robin flavour. If one of the configured servers fails, your user experience will be rather bad - with timeouts happening left and right. If you do want to implement this, you'd need to implement your own upper level policy dæmon for this, name resolution is a very basic feature of your network and is expected to be reliable.

That said, I would not recommend to hardcode the nameservers of 'normal' ISPs (which don't explicitly document the addresses, but hand them out automatically as part of the DHCP lease), while they might not change on a daily basis, they aren't likely to be cast in stone either.

1 Like