DNS Load Balancing Definition
Domain name system (DNS) load balancing is distributing client requests to a domain across a group of server machines by configuring a domain in the Domain Name System (DNS) to correspond to a mail system, a website, a print server, or another online service.
What is DNS Based Load Balancing?
Load balancing improves availability and performance by distributing traffic across multiple servers. Organizations speed both private networks and websites using various types of load balancing, and most websites and internet applications would not function correctly or route traffic effectively without it.
DNS, sometimes called the phone book for the internet, translates website domains such as avinetworks.com into IP addresses in a process called DNS resolution. Thus like a phone book connects names and phone numbers, DNS turns domain names into long, numerical IP addresses so that web servers can identify the sites along with connected devices. DNS resolution saves humans from having to memorize long, difficult number sequences to access applications and websites.
In DNS resolution, user browsers make DNS queries, also called DNS requests: they request the correct list of IP addresses of destination websites from a DNS server. DNS-based load balancing improves availability and performance by distributing traffic across multiple servers, but it provides different IP addresses through the DNS in response to DNS queries to distribute that traffic.
DNS load balancers may respond to a DNS query using various rules or methods for choosing which IP address to share. Round-robin DNS is among the DNS load balancing techniques used most often.
Advantages of DNS Load Balancing?
The advantages of DNS load balancing include:
Ease of configuration. Simply direct multiple DNS records for one hostname toward the various IPs serving web service requests. Traffic is routed at the DNS level so there are no additional server configuration changes to make and no software to install.
Health checks. DNS load balancing health checks monitor unhealthy and failed servers and remove them from client query requests almost instantly without affecting users.
Scalability. All servers sit behind a single external IP, so it’s possible to scale out and add DNS services dynamically without updating DNS name services.Improved performance. The traditional round-robin DNS approach accounts for neither health visibility nor server loading. High-volume DNS load balancing is based on load and performance.
Drawbacks of DNS Load Balancing?
Unfortunately, because DNS load balancing is a simple implementation, it also has inherent problems that limit its efficiency and reliability. Most notably, DNS always returns the same set of IP addresses for a domain because it does not check for network or server errors or outages, so at times it may direct traffic toward servers that are inaccessible or down.
Another potential problem is that both clients and intermediate DNS servers or resolvers, both to reduce the level of DNS traffic on the network and to improve performance. The system assigns each resolved address a validity lifetime or time-to-live (TTL). Short lifetimes improve accuracy but increase DNS traffic and processing times meant to be reduced by caching. Meanwhile, long lifetimes may prevent clients from learning of server changes quickly.
Standard DNS load balancing and failover solutions work well enough in many network environments. However, for certain classes of network infrastructures, the standard DNS load balancing failover mechanism does not function well:
- Any Internet Service Provider (ISP) network for whom DNS server failure would create performance issues for users at an unacceptable level because DNS is part of core services.
- Large service providers with high volume network infrastructures such as cloud service providers, network carriers, and high transaction data center environments.
- Service providers and businesses whose infrastructures must maintain high end-user performance requirements, such as online retailers, stock traders, etc.
- Global Server Load Balancing (GSLB) implementations.
DNS Load Balancing vs Hardware Load Balancing
Three major load balancing methods exist: DNS load balancing, hardware-based load balancing, and software-based load balancing. Here is the difference between DNS load balancing and hardware load balancing:
Equipment. Hardware load balancing supplements network servers with actual hardware to distribute and balance traffic based on those specifications of the hardware itself. DNS load balancing distributes client requests across many servers in different data centers using a domain name configuration under the Domain Name System (DNS).
Cost. DNS load balancing is typically lower cost, and may be a subscription. Hardware balancing has a higher cost up front for the equipment itself but does not usually involve additional costs until it is time to replace the hardware.
Maintenance. Typically physical hardware demands maintenance of its own, while DNS server load balancing solutions include maintenance.
Scalability. It is generally less expensive and easier to scale DNS load balancing, as users can utilize more servers by merely changing their subscription. Some providers offer global DNS load balancing services. Particularly on a global scale, it is more costly to scale and expand hardware balancing.
How to Configure DNS Load Balancing
To configure DNS load balancing for an API endpoint, a website or, another web service, point the A records for the website hostname to all IPs of the target machines. For example, five different machines serve requests for website.com hostname, and each has a unique IP address. Configure DNS load balancing here with five separate A records for website.com, each pointing to a different target machine’s IP address. Each new end user will be routed to a different IP address once the DNS changes are propagated.
Cloud-based DNS load balancing can also handle mail server traffic. The most common approach to implementing DNS load balancing for a mail server is to assign all MX records for a given domain the same priority (usually a priority of 10). Most SMTP servers target the first record in a response, and every time a request is made, the SMTP server resolving to the domain will get all MX records in a different order.
DNS Round Robin vs Network Load Balancing
Network load balancing is a broad term that describes the management of network traffic without detailed protocols for routing. DNS round-robin load balancing is a particular DNS server mechanism.
DNS round-robin load balancing distributes traffic to improve site reliability and performance, just like other kinds of DNS-based load balancing. However, rather than using a hardware-based or software-based load balancer, DNS round-robin uses an authoritative nameserver, a type of DNS server, to perform load balancing.
Authoritative nameservers contain A records or AAAA records. These DNS records contain the matching domain name and IP address for websites. The goal of a client DNS query is to find the single A (or AAAA) record of a domain. A DNS query will always return the same IP address in a basic setup, because each A record is tied to a single IP address.
In contrast, domains have multiple A records in round-robin DNS, each tied to a different IP address. As DNS queries come in, they are spread across associated servers because IP addresses rotate in a round-robin fashion.
If a round-robin DNS load balancer is using four IP addresses, every fourth request would return any one IP address. This makes it less likely that any one server will get overloaded.
The round-robin approach is popular, but there are other traffic routing methods. Some DNS-based load balancing configurations use a weighted algorithm to assign traffic proportionately based on capacity in response to DNS queries. Examples of this type of load balancing algorithm include weighted least connection and weighted round-robin.
Many approaches to DNS load balancing are dynamic, in that the DNS load balancers consider server response times and health when assigning requests. Dynamic algorithms all follow different rules and offer different advantages, but they do the same broader thing: optimize how traffic is assigned and monitor server health.
Least connection is one type of dynamic load balancing algorithm. In this configuration, traffic is assigned to the server with the fewest open connections at the time, based on server monitoring.
Another common dynamic algorithm is geo-location, where the load balancer assigns all regional requests to a defined server. For example, all requests originating in the US might go to server USA.
Finally, a proximity-based algorithm instructs the load balancer to assign traffic dynamically to the user’s closest server.
Does Avi Offer a DNS Load Balancing Solution?
Yes. The Avi DNS virtual service is a generic DNS infrastructure that can implement DNS Load Balancing, Hosting Manual or Static DNS Entries, Virtual Service IP Address DNS Hosting, and Hosting GSLB Service DNS Entries.
For more on the actual implementation of load balancers, check out our Application Delivery How-To Videos.