How to Setup a Simple Load Balancing using Round-Robin DNS

Round-Robin is an alternative method of load balancing, which does not require an expensive dedicated software or hardware node (load balancer).

It is very simple to setup by associate multiple IP addresses with a single domain name. There is no standard rules for deciding which server will be used.

For example, normally a domain have 2 DNS records (NS1 and NS2). A domain after implemented the Round-Robin will have more than 2 DNS records:

The IP address sequence in the list is permuted with each DNS response. Usually, the first address returned from a DNS query would be used,  so that on different connections, clients would be connected to different server, thus distributing the overall load among servers.

The Drawbacks

Although round robin DNS is very easy to implement, it has problematic drawbacks.

Caching Issues: It’s difficult to manage the record caching in the DNS hierarchy, as well as client-side address caching and reuse.

Load Distribute Consideration: Since there is no consideration for transaction time, server load, network congestion, etc. Some server might receive too many loads and some might get less.

Server Fail: If one of the server fail, the DNS will still continue to hand out that address and some clients will reach the inoperable service. However, solutions exist to overcome such limitations. For example, a modified DNS servers (such as lbnamed) can routinely poll the mirrored servers for availability and load factor. If a server fail to reply, it can be temporarily removed from the DNS pool.

Data Consistency: You have to update all the servers whenever you have change a file or update the database.

So Should I implement the Round-Robin DNS ?

If your server was falling overload, and wanted to spread the load to multiple servers, that might be a good reason to do this, at least temporarily.

Consider Round robin DNS load balancing for services with a large number of uniformly distributed connections to servers of equivalent capacity. Otherwise you should go for load distribution.