SOA and NS records vs root server listings

Kevin Darcy kcd at daimlerchrysler.com
Fri Feb 2 00:16:00 UTC 2001


Adam Augustine wrote:

> I have read the sections in the DNS and BIND 3rd edition book about the SOA
> and NS records, and I have a few questions about how they work.
>
> The book states "The SOA record indicates that this name server is the best
> source of information for data within this zone.",

With all due respect to Cricket _et_al_, I think that's a somewhat misleading
sentence. In all fairness, though, I'll point out that a few paragraphs later
(on page 62), when discussing the MNAME and RNAME fields of the SOA (the only
ones that contain names as opposed to numbers), the book says "Name servers
won't use these names -- they are meant for human consumption". Reading that,
one should realize that the MNAME field has no bearing on nameserver selection.
(Actually, that's not absolutely true either, since SOA MNAME is used by
Dynamic Update clients to try and determine the primary master for the zone).

> and "[NS records]
> indicate that there are [multiple] name servers for the zone..." (Brackets
> are my editing). How exactly does this effect what a server uses when
> looking up a zone from the root servers? For example, if the root servers
> have something like this:
>
> ns1.example.com 169.254.1.1
> ns2.example.com 169.254.2.1
> ns3.example.com 169.254.3.1
>
> As displayed in the whois database. And the named.conf entry for
> ns2.example.com looks like:
>
> zone "example.com" {
>         type master;
>         file "example.com.zone";
> };
>
> And the named.conf entry for ns1 and ns3 look like:
>
> zone "example.com" {
>         type slave;
>         file "example.com.zone";
>         masters {
>                 169.254.2.1;
>         };
> };
>
> And then the example.com.zone file for example.com looks like this:
>
> $TTL 86400
> @ SOA ns2.example.com hostmaster.example.com (
>         1       ;
>         10800 ;
>         3600    ;
>         604800;
>         86400   ;
>
>         NS      ns3.example.com.
>         NS      ns2.example.com.
>         NS      ns1.example.com.
>
> test1   A       169.254.1.2
> test2   A       169.254.1.3
>
> And then some random nameserver on the net tries to look up
> test1.example.com for the first time, what servers will he go to? First of
> course, he will go to the root and get back the above list of servers. Does
> he try the first one on the list first, or does it pick one somehow? Does it
> round robin the name servers?
>
> Then once it has the SOA record from ns?.example.com, will it go to
> ns2.example.com for each subsequent request, since it is listed in the SOA
> record? Or will it go to ns3.example.com since it is listed first in the
> list of NS records in the zone file? Or will it go to ns1.example.com
> because of the information in the root servers' response?
>
> Just trying to understand how it all works.

On the first lookup, it'll pick one of the NS records at random (actually the
.com server will probably randomize the NS records it returns in the referral,
so it doesn't really matter whether your local nameserver randomizes them again
or not). When using cached referral information, however, by default NS'es will
be chosen according to how *fast* the NS has responded in the recent past. You
can override this default somewhat using the "topology" option. See, generally,
page 244 of "da book" on this whole aspect of nameserver selection.

I'll emphasize again that, outside of the Dynamic Update context, the SOA MNAME
plays no part in nameserver selection.


- Kevin




More information about the bind-users mailing list