Round Robin DNS Load Balancing
Published: Thursday, May 20, 2004
How DNS load balancing works
When the request comes to the DNS server to resolve the domain name, it gives out one of the several canonical names in a rotated order. This redirects the request to one of the several servers in a server group. Once the BIND feature of DNS resolves the domain to one of the servers, subsequent requests from the same client are sent to the same server.
DNS load balancing implementation (Multiple CNAMES)
This approach works for BIND 4 name servers, where multiple CNAMES are not considered as a configuration error. Assuming there are 4 web servers in the cluster configured with IP addresses 123.45.67.[1-4], add all of them to the DNS with Address records (A Names) as below. The srv[1-4] can be set to any name you want, such as foo[1-4], but should match the next step.
srv1 IN A 123.45.67.1 srv2 IN A 123.45.67.2 srv3 IN A 123.45.67.3 srv4 IN A 123.45.67.4
Add the following canonical names to resolve www.domain.com to one of these servers.
www IN CNAME srv1.domain.tld. IN CNAME srv2.domain.tld. IN CNAME srv3.domain.tld. IN CNAME srv4.domain.tld.
The DNS server will resolve the www.domain.com to one of the listed servers in a rotated manner. That will spread the requests over the group of servers. Note: The requests sent to http://domain.com (without 'www') should be forwarded to http://www.domain.com in this case to work. For BIND 8 name servers, the above approach will throw an error for multiple CNAMES. This can be avoided by an explicit multiple CNAME configuration option as shown below.
options { multiple-cnames yes; };
DNS load balancing implementation (Multiple A Records)
This above approach with multiple CNAMES for one domain name is not a valid DNS server configuration for BIND 9 and above. In this case, multiple A records are used.
www.domain.tld. 60 IN A 123.45.67.1 www.domain.tld. 60 IN A 123.45.67.2 www.domain.tld. 60 IN A 123.45.67.3 www.domain.tld. 60 IN A 123.45.67.4
The TTL value should be kept to a low value, so that the DNS cache is refreshed faster.
Other considerations
The DNS based load balancing method shown above does not take care of various potential issues such as unavailable servers (if one server goes down), or DNS caching by other name servers. The DNS server does not have any knowledge of the server availability and will continue to point to an unavailable server. It can only differentiate by IP address, but not by server port. The IP address can also be cached by other nameservers, hence requests may not be sent to the load balancing DNS server.
Considering the functionality, the round robin DNS is not a load balancing mechanism but a load distribution option. Some of these drawbacks can be overcome by implementing an advanced version of the DNS load balancer using Perl scripts. The details can be found here.
Some other variety of load balancing can be performed by using a proxy server, where one of the web servers, is solely used for re-routing of traffic to the other servers. If Apache is used as a web server, the mod_rewrite feature of Apache can be used for this purpose as detailed in this Apache website article.
|
|
|
|
|
|
RELATED ARTICLES
|
|
Introduction To Server Load Balancing
Load balancing applies to all types of servers (application server, database
server), however, we will be devoting this section for load balancing of web servers (HTTP server)
.
|
|
SubDomain - The Third Level Domain
A subdomain is the part of the website address before the domain name. Learn about using subdomain names.
|
|
|
RELATED NEWS
|
|
Faryl Robin Steps Up Efficiency and Streamline Data Management with Centric PLM
Footwear company partners with Centric Software to build foundational digital infrastructure CAMPBELL, Calif., Oct. 11, 2024...
|
|
Oracle Helps Financial Institutions Manage Balance Sheet Risk and Fuel Growth in New Treasury and Finance Solutions
Solutions enable banks with deep insights and complex reporting on profitability, interest rate risk, and balance sheet trend...
|
|
Kiva AI Closes $7M Seed Round Led by CoinFund to Revolutionize Expert-Powered Data Solutions
Empowering AI builders with a scalable, human expert-driven platform for complex data workflows SAN FRANCISCO, Oct. 8, 2024 /...
|
|
Tim Draper leads $3.1 million CAD Round in Dreamwell AI, Influencer Automation Software started by ex-influencer Kazzy Khazaal
Influencer-marketing startup Dreamwell AI raised $3.1 million CAD from Tim Draper and others as it seeks to automate creator...
|
|
Thermaltake Launches Exclusive INTEL® 14th Gen Gaming PCs at Best Buy Canada Featuring NVIDIA® RTX(TM) 4080 Super for High-Performance Gaming
Thermaltake Unveils Three New Gaming Desktops with INTEL 14th Gen Processors and NVIDIA RTX 4000 Series, Now Available at Bes...
|
|
Submit News |
View More News
|
|
|
|
|
|
|
|