As a victim of the CenturyLink outage yesterday, I fixed the issue by setting my DNS server to Google’s
Pri: 8.8.8.8
Sec: 8.8.4.4
But I could have used Cloudflare’s server at 1.1.1.1
My question is, what would the effect be of making the secondary server Cloudflare’s? If there is a problem with Google’s server would it switch to Cloudflare? Would it mess up resolving websites? No effect?
What I’m reading is that while DNS servers should be listed in order of preference, there is nothing in the official DNS specs that mandates order of use. Thus, it depends on the particular implementation of DNS name resolution. Microsoft allegedly relies on the order given, but then it’s likely up to whoever wrote your router software what order your router does things. Most home networks, IIRC the router gateway is the default DNS and supplies the whole internal network.
And of course, having resolved a name, it will not ask again for a certain amount of time, keeping it in cache. I vaguely recall that time being about 1 minute.
And this cache time is managed by the authoritative name server for the particular domain. There is a TTL (time to live) value for each DNS record that specifies how long the record values are considered valid. This is usually set to 14400 or 4 hours, but can be more or less. A one minute value is way to short for most purposes because it would cause excessive and unnecessary calls to the DNS servers.
Normally it shouldn’t matter. All properly functioning DNS servers should provide the same results. There are exceptional cases, like if a domain changes its IP address, and one server still has the old address cached while another doesn’t, but the vast majority of the time it shouldn’t matter which server you connect to.
I have a custom DNS set on my cell phone to block ads. I have discovered that there are some corporate wi-fi networks (Walmart for example) that will not accept it. Instructions are here if anyone is interested in setting this up on a variety of systems:
The only rules are that you should pick primary and secondary DNS servers that are in close proximity to you. Most providers use Anycast to route requests to the closest server they operate. A secondary rule is that if you are running an internal DNS server, never use an external as secondary because it will never have your local entries.
Typically, you only ever use one DNS server. If it fails, you switch over to using the next in the list. “Fails” means “does not answer at all”. Your ISP may use a different algorithm: may actually use different DNS servers for different lookups, may use different ‘fail’ criteria etc.
You are probably just using the settings available in your router, and you have no options and no other choices: setting different companies (1.1.1.1 and 8.8.8.8 etc) is good because if the first one fails, you want to use a different one.