Will this work? One host name with two IPs?

Kevin Darcy kcd at daimlerchrysler.com
Thu Jul 26 22:52:18 UTC 2001


If you associate 2 different IP addresses with the name, then DNS servers will
give them out in essentially random order. So you'll get approximately 50% of
the connections/transactions/whatever to each of the servers.

If one of the servers becomes unavailable, then you should of course
immediately remove it from the list. But even after you do that, for some time
afterwards, clients will still be getting the answer with *both* addresses from
nameservers which have the old information cached. What happens then? If they
are lucky enough to get the working address first, then fine. If they get the
non-working address first, then most clients are smart enough to failover (not
*all* clients are, so it depends on your application). Even when they are smart
enough to do this, sometimes the failover delay is rather large (30 seconds or
more). So your site is still available, but approximately 50% of the accesses
may experience long delays. Some applications won't even tolerate such a long
delay and will abort the connection attempt. So the user will have to keep on
trying and trying until they can get through. Ugly.

There are various solutions to this problem. One approach is to have a "smart"
DNS server that gives out a single address, which will vary from answer to
answer, depending on the load/availability of the servers in question. But to
make that dynamic, typically this requires reducing the TTL value of the
relevant records to unacceptably-low levels (which makes nameservers all over
the network work much too hard to resolve the name). Also, many of the products
which implement this are in their infancy, so although they may get the
load-balancing function right, they still leave a lot to be desired as
general-purpose DNS servers. Their immaturity sometimes causes interoperability
problems with *real* DNS servers.

Another approach, which is often quite expensive, is to only publish a single
address and then have one or more network devices perform some routing magic
behind the scenes to send the HTTP requests (or whatever) to different servers,
depending on load and availability. Sometimes this is called L4 (Layer 4) load
balancing. It is a more technically-elegant solution, but, as I said, often
quite expensive.


- Kevin

HW wrote:

> Hello,
>
> My client would like to define one host name with two different IP addresses
> as failover.  The plan is that when one IP is not working, users can still
> use the same host name (but DNS will lookup to the second IP address) to
> access to the system.
>
> However, I am not quite sure if this idea will work or not.  Because I don't
> understand when DNS server answer the query by giving out the first IP as
> the answer, how does DNS server give out the second IP if the first IP is
> not working?
>
> Can anyone explain if my client's idea will work or not?
>
> Thanks,
>
> SC





More information about the bind-users mailing list