Stupid question
Roy Arends
Roy.Arends at nominum.com
Fri Aug 17 12:04:21 UTC 2001
On Fri, 17 Aug 2001, no mail wrote:
> How does DNS decide which root server from the cache.dns file to send its
> query to? Obviously if all requests tried to go to A.root-servers.net
> first, it would have an unfair load.
>
> How's this work?
A bind 8 caching resolver does this as follows. It keeps track of the
round trip time per nameserver. Whenever it has a choice from a list of
nameservers, it will take the fastest (shortest rtt). It will then
calculate new rtt's as followes:
rtt(queried ns) = ( .7 * old-rtt) + (.3 * cur-rtt)
rtt(non-responsive ns)= (1.2 * old-rtt)
rtt(other) = (.98 * old-rtt)
The values can be found in src/bin/named/ns_defs.h:
#define ALPHA 0.7 /* How much to preserve of old response time */
#define BETA 1.2 /* How much to penalize response time on failure */
#define GAMMA 0.98 /* How much to decay unused response times */
These values are used in src/bin/named/ns_resp.c
DJBDNS picks a server at random, using a prng.
For other brands, I don't know, though I'm curious.
Note that for instance the Netscape applications use their own
DNS-resolver (dns-helper).
Roy Arends
Nominum
-------------
0-14-023750-X dcrpt ths 43.0D.01 01.05.0C 84.18.03 8A.13.04 2D.0B.0A
More information about the bind-users
mailing list