delegation - pri and sec dns

Nishal Goburdhan nishal at is.co.za
Tue Jul 25 12:02:48 UTC 2000



taken from www.acmebw.com/askmrdns/ - you will find answers to most dns questions there, in one form or another, if you try the search utility.

 
> Hi all,
> 
> just would like to ask a simple question :
> 
> do the primary and secondary authoratative DNSes 'share' the load in that
> sometimes the pri dns gets hit or the sec dns gets 'hit' depending on server
> response time. OR is it the primary always gets the request and the
> secondary gets the request only if the named daemon on the primary is down.
> 
> appreciate any helpful answers. Appreciate if u reply all to
> phil46 at pacific.net.sg as well.
> 
> thx.


The mirror site you refer to is a "secondary" (the older term) or a "slave"
(the newer term).  The authoritative name servers for a zone--the primary
master and the slaves--are advertised to other name servers via NS (name
server) records.   (Actually, there isn't always an NS record for the
primary master, but that's another question and another answer.)

A name server looking up a name first needs the list of NS records for the
zone the name belongs to.  The name server might already have the NS
records in its cache or it will retrieve them in the course of answering
this query.  These multiple NS records are the heart of your question: How
does the querying name server decide which NS record to use, which
authoritative name server to ask?  Mr. DNS is glad you asked.

The querying name server calculates and stores a round trip time (RTT) for
each name server for a zone (i.e., for each NS record).  The RTT is the
time--in milliseconds--that it takes that name server to respond to
queries.  When faced with multiple sources of information about a zone in
the form of multiple NS records, the querying name server asks the name
server with the lowest RTT.  In the case of a tie, it picks among them at
random.  After a name server is queried, the querying name server updates
its RTT.

When a name server first caches a list of NS records, the RTT for all of
them is zero.  Because it chooses among name servers with equal RTTs at
random, each name server will be queried once.	From then on, it favors the
name server with the lowest RTT.  But what if something happens to that
name server with the lowest RTT?  Fortunately, whenever a querying name
server consults the name server with the lowest RTT, it decrements all the
other name server's RTTs a little bit.	Over time, the other RTTs creep
down and will eventually be queried.  Of course, if they are slow to
respond, their RTT goes back up and they're not consulted again for a
while.

So to answer your question, it isn't just the primary master who is
consulted--all the authoritative name servers for a zone are consulted by
other name servers.  A querying name server will eventually favor the
authoritative name server which responds the fastest.

Mr. DNS




More information about the bind-users mailing list