When I setup more than 1 DNS server in RouterOS, will it always use the first in the list as long as that responds?
Or may more servers get used?
When both static and dynamic servers are set, static server entries are more preferred, however it does not indicate that static server will always be used (for example, previously query was received from dynamic server, but static was added later, then dynamic entry will be preferred).
It looks like, when responding then it is used to resolve. DNS list is handled top-down, if DNS entry one fails DNS entry two takes over and is used till it fails or the router is restarted. This goes up for static and dynamic or a mix and it will try to find working one going down the list till it burns out the router. ![]()
I have 6 DNS servers listed and they indeed do rotate based upon other parameters. I also have my query timeout set for 500ms and my total timeout set for 5 seconds. I try not to wait too long for responses and it works for me to move from server to server.
If set for 2 seconds (default), I would think it would always query the same one all the time unless of course it takes more than 2 seconds to get a response before it has to go to the next one in line
I did a test.
On my main Router I did setup two static DNS server.
- Intern DNS server
- External 1.1.1.1
Looking at the log of DNS usage, it seem that it prefer the 1.1.1.1. Very few records was sent to my internal DNS.
When I remove 1.1.1.1, all goes fine to my internal DNS.
Internal DNS uses DoH so I would like to have 1.1.1.1 as just a backup of Internal DNS fails.
Maybe I setup a ping script and change DNS if internal one fails.