Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When providing nameservers to my domain's registrar, i.e. nameserver 1 nameserver 2 nameserver 3 nameserver 4

Do ISPs and computers always use the nameserver in order? i.e. where nameserver 1 is up it will be used, if not, nameserver 2 will be attempted to be used

Or can ISPs and computers use a different order?

share|improve this question
up vote 6 down vote accepted

You can not guarantee and should not rely on the order used by DNS resolvers. DNS caching can make such predictions even more complicated.

share|improve this answer
@capuccino see also: – the-wabbit Mar 3 '13 at 13:48
Thanks! Generally would the order be followed? All of my nameservers should be working, but as my nameserver 1 and 2 are from CloudFlare, I would want most of the traffic going through there for the CDN speed benefits. My nameserver 3, 4, 5, 6 and 7 are from Dyn and serve as redundancy in case CloudFlare's nameservers fail (which they have), but they do not benefit from CDN speeds. – cappuccino Mar 3 '13 at 13:53
@cappuccino Generally there will be no order. At all. Ever. It is even never supposed to be followed. – Sandman4 Mar 3 '13 at 14:58

In general, the order of the RRs as returned by the client resolver is undefined. Certain RR types allow for the specification of a precedence or priority - especially the MX and the SRV resource types.

If your implementation does not use one of these (and you asked for NS RRs which are unordered), you should consider all RR responses to be unordered as a conservative assumption.

This being said, most DNS server implementations would serve the RRs in the order you define them in the zone file unless you enable DNS-roundrobin. Caching resolvers may have roundrobin enabled but typically won't.

Client caches for IPv4 typically do not reorder all that much as well. With IPv6 things look different, though. RFC3484 Default Address Selection for IPv6 defines reordering in section 6 which is implemented at least in the Microsoft DNS Client.

What NS RR a DNS server recursing through to your zone is going to use in the end, is very much up to its implementation. Keep in mind that a (caching) DNS server would not rely on the operating system's implementation for resolving DNS queries but come with an own, likely including the ability to query multiple servers simultaneously and pick the fastest responding one for subsequent requests.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.