I have optimum online ISP and sometimes their DNS servers go down. Like 99.9% of the year they're fine and the other times they're not. What I do during those times is in Luci I'll uncheck Interfaces > WAN > "Use DNS servers advertised by peer" and in Use custom DNS servers I will add 8.8.8.8 as a Custom DNS server.
What I want to know is how I can leave "Use DNS servers advertised by peer" checked so that ISP DNS servers are used by default but then also use 8.8.8.8 as a fallback.
Is there a way to add a custom fallback while still keeping the ISP servers primary? I have searched for this topic on Google but all the instructions are how to effectively override the ISP DNS servers by disabling them and setting a custom one, like I described above.
But if I add that option doesn't it mean that all clients will get 8.8.8.8 instead of dnsmasq using it as a fallback? What I'm saying is I want all clients to use 192.168.1.1 to go through the router DNS server (like they already do, in other words nothing changes for clients) but then dnsmasq can use 8.8.8.8 as a fallback
you can always point the clients to 192.168.1.1, then apply the upstream change in either dnsmasq or the firewall.
pretty sure there's no "backup" or "primary" DNS in dnsmasq, if you want it hard, configure a firewall rule rerouting the traffic, when you detect the primary DNS server is down.
then the 192 will be primary for the clients.
if it goes down, they'll automagically switch to 8.8.8.8, and when the 192 comes back online, switch back, but not immediately.
If the only concern is provider's DNS going down you you just set your DNS to a pair the public fast ones:
Ie in Luci -> Network->DNS and dhcp -> Forwards and enter a consistent pair of servers from any of providers (quad9 is most privacy friendly, google or cloudflare may be milliseconds faster)
There is more detailed setup possible like totally not using providers dns, or using it selectively for providers domains, or using some DNS encryption option,if you have relatively powerful router, thus please provide output of ubus call system board
https://www.dnscheck.tools/ shows that both optimum online (cablevision) and google nameservers are queried. I expected only optimum online nameservers would be used but maybe that is because of the recent problems with the optimum online nameservers. I'm going to give it a few days and see how it works.
According to dnsmasq man pages -o, --strict-order
By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers that are known to be up. Setting this flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf --all-servers
By default, when dnsmasq has more than one upstream server available, it will send queries to just one server. Setting this flag forces dnsmasq to send all queries to all available servers. The reply from the server which answers first will be returned to the original requester.