Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
See my answer here: serverfault.com/questions/327708/… –  Sandman4 Dec 28 '13 at 20:01
add comment

2 Answers 2

up vote 7 down vote accepted

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 most 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.

share|improve this answer
    
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 '13 at 21:32
3  
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 '13 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 '13 at 22:47
    
Yep. Just wanted to give you the caveat that it depends on the application. YMMV, etc. –  Ryan Ries Dec 27 '13 at 22:50
    
@RyanRies, Does the RFC give any recommendations with regards to client behavior? Is Telnet compliant when it tries out all the IPs instead of merely using the first one? –  Pacerier May 14 at 5:45
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.