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

When I querie ns server on a .NET servers, answers are always in the same order :

dig ns google.net @F.GTLD-SERVERS.net +short
ns1.google.com.
ns2.google.com.
ns3.google.com.
ns4.google.com.

If I don't use .net server anwser is rotated :

dig ns google.net +short
ns4.google.com.
ns1.google.com.
ns2.google.com.
ns3.google.com.
dig ns google.net +short
ns2.google.com.
ns1.google.com.
ns4.google.com.
ns3.google.com.

com. servers seems to work like net. servers (no rotate), but org. servers and all other I tried seems to rotate answers.

Why net. and com. servers don't rotate their answers ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Short answer could be "why should they ?" or "why are the other doing it ?", but what's the fun of a short answer ?

It mainly depends on the software configuration running on the server, BIND has a configuration directive named rrset-order which does just that, for instance, if you have :

rrset-order {order fixed;};

BIND will always return the resource records in the order they are in the zone file.

With :

rrset-order {order random;};

the records will be returned in a random order.

The thing with randomness is that it does not exist in a computer. Operating systems go to a gread deal of effort to create pseudo-randomness by harvesting "random" events like interrupts, network trafic, keyboard or mouse events, and so on.

But the more you call random(3), the less it gives really random values and the more it's results can be predicted.

In our case, the randomness of results to a DNS query, the servers for com. and net. will never (well, they could, but you don't want to mess with the glue) be used to return results for, say, www.google.com, that's google.com's name servers business, so, it does not hurt to always returns google.com's name servers in the same order, once your recursive name server gets them, it'll use them in a round robin order to make queries anyway.

share|improve this answer

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.