SOA and NS records vs root server listings

Adam Augustine adam_augustine at morinda.com
Thu Feb 1 23:23:02 UTC 2001


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.", 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.

Thanks for the help,
	Adam Augustine


More information about the bind-users mailing list