Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DNS round robin with hosts file and browsers on windows

Posted on 2013-01-07
9
Medium Priority
?
5,205 Views
Last Modified: 2013-02-15
I've been playing around with the following scenario and I'm wondering if this should work in theory:

Configure the following in the hosts file on windows:

<IP of server that's down>     hostA
<IP of server that's down>     hostA
<valid    IP>     hostA

and then access http://hostA:8080 in Chrome, FF and IE. My hope is that all three browsers will eventually find the hostA mapping to the valid IP.

Right now I'm testing with IE and I'm seeing some odd results where it sometimes seems to work and sometimes it doesn't. I wanted to check to set if this configuration and the result I'm expecting are valid.
0
Comment
Question by:opike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:DrDave242
ID: 38752699
I have to ask: what's your ultimate goal?  There may be a better way to accomplish it than by messing around with hosts files (which is almost never the best way to accomplish anything, in my opinion).
0
 
LVL 57

Expert Comment

by:giltjr
ID: 38753067
All 3 IP addresses are "valid."  Just because a host, or a service on a host, may be down, does not mean the IP address is invalid.  It just means that you will not get a response.

If you are hoping that a browser will try each IP address returned until it finds one that responds, you are out of luck.  Browsers will use the 1st IP address returned and that's it.
0
 
LVL 16

Expert Comment

by:Bruno PACI
ID: 38754244
Hi,

As giltjr explained round robin is not a high availability solution, it's only a load balancing solution. DNS will load balance requests because of round robin but is not in charge to check availability of services "behind" IP addresses.
So DNS gives you an IP even if the server or services associated to this IP are down.

Applications may be smart enough to check all IPs in the list obtained from DNS until they find an "alive" one... But browsers are not that smart: they ask for an IP, and if this one is "bad" they fail....
0
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 

Author Comment

by:opike
ID: 38755802
My ultimate goal is to test the server retry capabilities of the main browsers, which it turns out, all three main browsers (FF, Chrome, IE) possess. This configuration wasn't meant to be a permanent set up, I just wanted to see how the browsers would be have when one of the IPs configured to a host was not available. This blog post covers the high-availability of browsers in more depth:

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

Expert Comment

by:giltjr
ID: 38756005
So you were trying to do a test to prove that testing another person did was right?

O.K., I can live with that.  However what the article says is right.  Most web browsers try the 1st IP address returned in a list and stop there.  In fact most IP based products stop after the 1st address.  Just easier for developers to write code that gets one thing, tries, and fails.

As PaciB stated, round robin DNS was a crude attempt at load balancing.  Was never meant to be used for fail over recovery.
0
 

Accepted Solution

by:
opike earned 0 total points
ID: 38756101
Giltjr states: "Most web browsers try the 1st IP address returned in a list and stop there. "

That is not what the article states.

I quote:
"You’d have your program ask the network API for all of the IP addresses associated with a name, and then your program can try them one at a time until it gets something to connect...
<some text omitted>
As it happens, it appears that they (browsers) all do work that way"

My testing confirmed that browsers do in fact behave this way.

Also, I'm not looking for load balancing, just fail over. For our current needs, the fail over capability now built into the all modern, popular browsers, is sufficient.
0
 
LVL 27

Expert Comment

by:DrDave242
ID: 38756175
I'll admit, this functionality is news to me, but if it works, more power to you.  However, if this is for anything but a very small number of users, you'll want to implement it on your DNS server rather than clients' hosts files for ease of administration.  Of course, that means you may get inconsistent results due to client-side caching...

You mentioned that you're seeing some odd results during testing.  Have you used a packet sniffer to see what addresses the test machine is trying to contact?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 38756508
Misread his results.

This is news to me too.  I will have to do some testing as what he shows as his results have not been what I have experienced.
0
 

Author Closing Comment

by:opike
ID: 38892432
Completed testing and confirmed the results of the article on my own.
0

Featured Post

Introducing the WatchGuard 420 Access Point

WatchGuard's newest access point includes an 802.11ac Wave 2 chipset, providing the fastest speeds for VoIP, video and music streaming, and large data file transfers. Additionally, enjoy the benefits of strong security as the 3rd radio delivers dedicated WIPS protection!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question