The Round-Robin DNS solution is recommended only if a hardware-based loadbalancing solution is unavailable. Round-Robin DNS is a mechanism for cycling through a list of Web server IP addresses for a single Web host name.

Suppose that you have two Web servers, www1.yourdomain.com (192.168.1.10) and www2.yourdomain.com (192.168.1.20), and you want to balance the load for www.yourdomain.com on these two servers by using the Round-Robin DNS trick.

Just follow these steps:

1. Add the following lines to your yourdomain.com zone file:
www1 IN A 192.168.1.10
www2 IN A 192.168.1.20
www IN CNAME www1
www IN CNAME www2

2. Restart your DNS server and ping the www.yourdomain.com host. You will see the 192.168.1.10 address in the ping output.

3. Stop pinging and then start pinging the same host, and you’ll see the second IP address being pinged, because the preceding configuration tells the name server to cycle through the CNAME records for www. In other words, the www.yourdomain.com host is both www1.yourdomain.com and www2.yourdomain.com.

When someone enters www.yourdomain.com, the name server gives out the first address once, then gives out the second address for the next request, and keeps cycling between these addresses.

A disadvantage of the round-robin trick is that the DNS server has no way of knowing which system is heavily loaded and which is not—it just blindly cycles. If one of the servers crashes or becomes unavailable for some reason, the round-robin DNS trick still returns the broken server’s IP on a regular basis. This means that some people will be able to access the sites and some won’t.