Primary and Secondary

Kevin Darcy kcd at daimlerchrysler.com
Tue Jun 26 00:16:12 UTC 2001


Jon Booth wrote:

> When is a secondary server used in a request. Is it only after the primary
> is unreachable or timesout, or are both contacted and the quickest to
> respond wins?

The nameservers are tried initially at random and then good nameserver
implementations keep track of how fast each nameserver responds and will
prefer faster ones for subsequent queries. But they'll still occasionally try
slower ones in case they have improved.

> Because I was thinking. A way to have redundancy in web servers would be
> to have two webservers A and B. A has the primary nameserver and webserver
> for the domain which returns its own IP for www. B has the backup
> webserver and secondary nameserver and returns its own IP address.

You shouldn't call one a "secondary" in that case, since it's not replicating
identical data from the master. These are two different masters and
incoherent zone data.

As you probably realize from my description above, you'd have to somehow
fudge the response rates of the nameservers to make this work even a little
bit, and even in the best-case scenario, you're going to get a lot of
"leakage" to the backup server. Not only that, but once the answer is cached
by a remote nameserver, it'll just use the answer from its cache, even if
that particular webserver is down or overloaded.

Why not just mirror the website and give out *both* addresses for the name?
That's the usual (imperfect) way to do failover/load-balancing using DNS. For
a more industrial-strength solution, get a commercial load-balancer/cluster
product that frontends a whole web farm behind a single IP address.


- Kevin



More information about the bind-users mailing list