top of page
  • Writer's pictureRohit Modi

Domain Name System aka DNS : Load Balancing

Updated: Dec 18, 2022

Hi, Welcome to tech-maze, in today's article we will touch upon Domain Name System aks DNS and how this can help in organizing the traffic, we generally use load balancer once request comes to our server which is within organization or cloud network, what if we can balance load at DNS level as well, redirect the request to different gateways and then our existing system process the request.


DNS is mostly used for redirecting the request to the application by checking the mapping data where domain name is mapped to the actual IP address, here all the request which comes to DNS, redirected to the application server/gateway.


DNS load balancing is the practice of configuring a domain in the Domain Name System (DNS) such that client requests to the domain are distributed across a group of server machines or gateways


For the application which are widely used, lets say an application which has used in multiple countries, then we can map domain name with multiple IP address of our application servers, lets visualize this by looking into following diagram.



In the diagram we can see, request are coming from different countries and DNS resolve domain name based on the header parameter and forward the request to respected gateways


domain :- www.domain.com

header parameter :- USA

mapped to :- 176.10.40.1 (Gateway 1)



domain :- www.domain.com

header parameter :- IND

mapped to :- 10.140.20.3 (Gateway 2)



domain :- www.domain.com

header parameter :- UK

mapped to :- 110.140.30.2 (Gateway 3)



By doing this, we reduce the load on one Gateway server, So here, we have implemented load balancer at DNS level, the only restriction here is , we can only have Round Robin algorithm.

The initial investment for this setup is expensive but it gives good result in future.


Today many domains use multiple gateway/server machines to protect against server failure or handle high traffic volume, among other reasons and in this case DNS returns a list of all the servers’ IP addresses in response to a name resolution request.


Now lets checkout pros and cons of having load balancer at DNS level, but any point of time balancing load at DNS level always help and mostly land at pros.


Pros:


  • Easy to configure and understand.

  • DNS based cluster nodes don’t require multiple network interface cards (NICs). Each machine can have a single NIC with a unique IP address.

  • Multiple IP addresses can be assigned to the host record. The DNS server can rotate these addresses in a Round-Robin manner.

  • Load balancing pools for various geographic regions are established. The administrator can take advantage of infrastructure dispersed geographically and improve performance by reducing the distance between the receivers and data centers.


Cons:


  • It doesn't support dynamic load re-balancing, but this is the case with all web based application

  • DNS doesn't support any other load balancer algorithm except Round Robin.

  • No failure detection, it doesn't care if connection established twice to the same server.

  • DNS cannot tell if a server has become unavailable, but this is the case with all web based application

  • Load may not be evenly shared as DNS can not verify how much load is present currently on the servers.


That's all folks in this article, please let me know your input/suggestion/thought in comment section, keep visiting for more articles.


A Big thank you for checking out my article, this really encourage me to come up with more topics.

36 views0 comments

Recent Posts

See All
Spring Boot

©2022 by tech-maze. Proudly created with Wix.com

bottom of page