2

If I create multiple DNS A records for the same hosts, for example:

my-domain.com   A   1.2.3.4   3600s
my-domain.com   A   4.5.6.7   3600s
my-domain.com   A   7.8.9.0   3600s
  1. Do queries really round robin between the three servers? Is it even?

  2. Let's assume a client requests my-domain.com and gets back 1.2.3.4. Is that then cached for an hour, so every request the client makes will use 1.2.3.4, or will each request grab a random host?

  3. What happens if 4.5.6.7 goes down, does DNS automatically take it out, or will requests still route to it in round robin fashion?

2 Answers 2

2

Yes, you can implement some load sharing using multiple DNS records for the same service. However, this is not the best way to implement load sharing especially in case you have all your hosts reside in the same location. A far more efficient approach will be to use a dedicated machine as load balancer. This machine receives all traffic and forwards it to one of the real servers based on several criteria such as:

  1. Concurrent connections.
  2. Server load.
  3. User source IP.
  4. Round robin.
  5. Weighted round robin, etc...

Another important point in load balancers such as haproxy is the ability to check for failing node and exclude it from the servers list and this is not available in DNS-based method.

Also, DNS caching makes things more complicated and difficult to manage. DNS caching can occur in any node from your client to any intermediate DNS server till reaching the authoritative DNS server.

3
  1. Yes, it will round robin between the three. For windows server DNS, you need to enable Round Robin in your DNS server. When enabled, it will respond with all three records in a rotating pattern:

    • 1st client - 1.2.3.4, 4.5.6.7, 7.8.9.0

    • 2nd client - 4.5.6.7, 7.8.9.0, 1.2.3.4

    • 3rd client - 7.8.9.0, 1.2.3.4, 4.5.6.7

  2. This depends on the implementation on the client side. Some clients will rotate between the records per connection, and some will tend to use the first address received. The load is still balanced since the second client above would have a different ordered list than the first.

  3. If 4.5.6.7 were to go down, it would not be automatically removed. Clients would still attempt connections on that IP. This is the drawback of Round Robin DNS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .