10

Let's say I have 2 IPs for a given domain (round-robin DNS).
If one the IPs becomes unresponsive, will clients try to connect to the other IP? or they will just fail to establish comunication with the domain?

1

3 Answers 3

15

DNS round robin is not a good substitute for a load balancer. The DNS server will continue to hand out the IP of the node that is down, so some of your users will get to your service and some of them will not.

When the client makes the DNS query, the DNS server returns all of the IP addresses associated with that name. The magic is done by the DNS server rotating the order of that list for every query. However, it is up to the application to implement the capability of "walking" through the list until it finds an IP that works. And some applications don't do that.

Windows Telnet, oddly enough, is one such application that is smart enough to walk the linked list of returned IPs. You can see this behavior yourself if you attempt to telnet to google.com, for example. You will notice that it takes a long time to finally fail. That is because google.com has a lot of IP addresses, and the telnet client was trying every one.

9
  • I understand that clients always get both IPs from the NS. It's just that by default they choose the first one in the list. But what if the first one is down? will they try with the second one?
    – GetFree
    Dec 27, 2013 at 21:32
  • 13
    It totally depends on the application. If we're talking about web browsers for instance, most modern web browsers will walk the list until they succeed, some browsers (usually older ones) will just fail after the first unsuccessful IP is tried. More info: nber.org/sys-admin/dns-failover.html and blog.engelke.com/2011/06/07/web-resilience-with-round-robin-dns
    – Ryan Ries
    Dec 27, 2013 at 21:40
  • According to the links you gave, it seems that it does work. At least for HTTP clients (which is what I care about right now). All modern browsers and even lower level HTTP clients fail-over to another IP in the list.
    – GetFree
    Dec 27, 2013 at 22:47
  • 2
    Most applications do try different IP addresses.
    – Fluffy
    Nov 18, 2014 at 10:33
  • 1
    I think some Answerers are confused into thinking we want a Load Balancer. That's not what we want. I'm looking for when half the State of Georgia goes dark, taking down our datacenter with it, that our customers can still connect to some other datacenter in some other part of the world that so happens has NOT gone dark. Georgia can get ALL the Load 99% of the time, I don't care, so long as New York is available to pick up where we left off for that 1% should Georgia go dark.
    – UncaAlby
    Jul 1, 2016 at 23:46
19

Using a Load Balancer will still leave a single point of failure. If your load balancer goes offline, your website goes down.

Conterary to the above answer, Most HTTP clients already DO support trying each IP address returned from a DNS query until one returns with a valid response. Please see here:

http://blog.engelke.com/2011/06/07/web-resilience-with-round-robin-dns/

It appears that the author has tested the following browsers and found them to work fine.

Chrome 11 on Windows 7
Firefox 4.0 on Windows 7
Internet Explorer 8 on Windows 7
Opera 11 on Windows 7
Safari 5 on Windows 7
Internet Explorer 7 on Windows XP (after noticeable delay)
Firefox 4.0 on Windows XP (after noticeable delay)
Android native browser on Android 2.3.3
iPhone native browser on iOS 4.3.3

Using round robin wont do all the features of a load balancing server, things like being able to monitor response times from both servers, and route more traffic to one, if the other is not responding as fast as it should). For resilience, I would say Round Robin DNS is probably a better solution as there is no longer a single point of failure.

1
  • See second comment in the accepted answer
    – GetFree
    Sep 26, 2014 at 19:36
2

While round robin DNS does not typically have feedback into the status of the servers it is providing addresses for, it may help if you then have some sort of load balancer (including router-based tricks) for each of those addresses.

There are tricks to update DNS as things fail; if this happens, round-robin DNS with suitably short TTLs can be a pseudo-load balancer.

You must log in to answer this question.

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