views:

40

answers:

2

I want to know how this is handles or if there is a standard?

+1  A: 

Browsers cache DNS Responses for a few minutes and typically attempt a connection with the first IP address returned in the DNS response. The same IP is used until the cache expires.

Internet Explorer caches DNS lookups for 30 minutes by default, as specified by the DnsCacheTimeout registry setting. Firefox caches DNS lookups for 1 minute, controlled by the network.dnsCacheExpiration configuration setting.

From: Yahoo Dev Network: Best Practices for Speeding Up Your Web Site

Therefore for multiple IP addresses to be used for load-balancing purposes, the DNS server must change the order of the addresses supplied in the response, choosing the order randomly or in a sequential "round robin" fashion. In fact, this is usually the default behaviour of DNS servers when they respond to hostnames with multiple A records.

There is no standard procedure for deciding which address will be used by the requesting application - a few resolvers attempt to re-order the list to give priority to numerically "closer" networks. Some desktop clients do try alternate addresses after a connection timeout of 30-45 seconds.

From: Wikipedia: Round robin DNS

Daniel Vassallo
So what happens when a browser has the entry cached and the server goes down/becomes unreachable. does it mean a requery on the dns to get the new entry. Also, do the plugins also follow the browser(like the flash plugin)? or do they have their own thing going on?
Ankur Chauhan
@Ankur: As for plugins, they have their own thing. Most plugins even have provide a full TCP socket API, so they can do lookups themselves, and in general have nothing to do with the browser, except for being plugged into the document. As for your question, I believe yes, it will remain down until the cache expires, but I'm not 100% sure on that... I'm checking if I can find some authoritative answer...
Daniel Vassallo
A: 

Generally they iterate through the responses and use the first one they can connect to.

nos