Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When providing nameservers to my domain's registrar, i.e. nameserver 1 dns1.example.com nameserver 2 dns2.example.com nameserver 3 dns3.example.com nameserver 4 dns4.example.com

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
add comment

2 Answers

up vote 7 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: en.wikipedia.org/wiki/Round-robin_DNS –  syneticon-dj 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
2  
@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
add comment

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
add comment

Your Answer

 
discard

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.