How To Implement Round Robin DNS for Load Balancing Servers

By Angsuman Chakraborty, Gaea News Network
Thursday, August 23, 2007

Round robin DNS is a simple way to load balance your servers. You can use it balance the load between multiple web / ftp or other servers. Each server has its own IP address. In round robin mode the DNS serves one of the available IP addresses in random order to the requester. The simplest way to implement round robin DNS is with A records in your zone file. For example my taragana.com.hosts file (zone file for taragana.com zone which is used by Bind name server) currently has the following entries:

taragana.com.                   IN A            72.36.134.170
                                           IN A            72.36.134.130

This ensures that any request to taragana.com is served alternatively by one of the following IP addresses: 72.36.134.170 and 72.36.134.130.

Note: You can normally find your zone file in /var/named or /var/named/chroot/var/named directory.
You can use this simple technique to load balance between multiple web servers or ftp servers. You can verify it by pinging taragana.com and you will, unless you have a caching nameserver in between, alternately get both the IP addresses.

Such load balancing is ideally suited for stateless web services like serving images and files or web / blog pages.
However even for statefull services like web based applications this works because the browser caches the IP address and goes back to the same server for processing subsequent requests.

Note: In my case however they both point to the same server currently. So what’s the point? I am actually transitioning the IP addresses from 130 to 170. So this is the intermediate step I decided to take and then on Saturday I will remove the 130 entries from my DNS server.

BTW: Round robin DNS by itself doesn’t provide a failover support as the DNS doesn’t have any knowledge about the servers it is pointing to. However you can write scripts to monitor the server and request the DNS to take down or bring up one or more servers from its list.

Discussion

jignesh mithapara
January 29, 2010: 6:30 am

hello sir,
I want to make Server Load Balancer in Window.I am confuse about how to start it and how to doing So please send me some code or basic information about it.

Thanxs,
Jignesh Mithapara

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :