DNS loadbalancing

Kevin Darcy kcd at daimlerchrysler.com
Wed Jun 14 22:35:22 UTC 2000


Are you talking about distributing DNS load between servers, or are you
talking about using the DNS to distribute the load between servers for
non-DNS protocols, e.g. SMTP, HTTP or whatever? "www.microsoft.com" is an
example of the latter, not the former.

If you want to distribute DNS load, this is already automatic with BIND's
implementation of DNS: when you publish multiple servers for a zone, then the
queries will be distributed among those servers, depending on how quickly
each server responds to its requestors. But you don't set up multiple
"masters"; you set up one "master" (where you maintain the original copies of
the DNS data) and one or more "slaves" (which get replicated copies of that
data), although other servers generally don't care about the master/slave
distinction.

If you want to use DNS to balance some other kind of load, e.g. webserver
load, then you could simply create a multi-valued A record like
www.microsoft.com, i.e. a single name which resolves to multiple addresses.
By default, BIND will present such multi-valued A records in "cyclic" order,
which means that it picks the first address for the response at random and
then the subsequent addresses are given in rotational order, "wrapping
around" to the beginning of the set, if necessary. So different clients will
see the address list in different orders, and since they usually try the
addresses in the order they receive them in the response, the load will be
split up.

"Cyclic" order may not be the best response ordering scheme in a failure
scenario (when one server fails, the next server in line may be clobbered
with a big volume spike because of all of the clients failing over), so you
may wish to consider changing the response order to "random" on all of your
masters and slaves; however, in that case be aware that intermediate caching
servers may still give out the address in "cyclic" order or -- in the case of
older BIND versions and possibly also some non-BIND implementations -- true
"round-robin" order, in which the starting address record is advanced
(rotationally) for each response. You can defeat the effect of intermediate
caching servers somewhat by lowering the TTL (time-to-live, which controls
cache persistence) on your records, but in that case you will burden your
servers and remote servers with extra DNS traffic.

If you need true *dynamic* load balancing, there are non-DNS-based
approaches, which present a single address for the farm/cluster, and then
play routing tricks "behind" it to direct the queries to the appropriate
server. A lot of these products will monitor the health and/or performance of
each server in the farm/cluster, and route accordingly, so the load balancing
can be of superior quality to anything you could get via DNS alone. But these
products tend to be rather expensive.


- Kevin

Jangalwa, Raj wrote:

> Hi Gururs,
>
> We are coming up with whole new and different sites and I need some
> information on how can I achieve DNS load balancing. I wanna setup 2-3
> master DNS servers and load balance them. If anybody has any information
> about "akamai" also please do send me that.
>
> for example if you do nslookup on "www.microsoft.com" it comes back with
> more than 1 IP addresses. I am sure they are also doing something like DNS
> load balancing.
>
> I'll really appreciate if someone can give me some informations and
> suggestions on it.
> Thanx
> -Raj






More information about the bind-users mailing list