How browsers handle multiple IPs
Posted
by
Sandman4
on Server Fault
See other posts from Server Fault
or by Sandman4
Published on 2011-11-04T09:33:23Z
Indexed on
2012/07/06
15:17 UTC
Read the original article
Hit count: 266
Can someone direct me to information on exact browsers behavior when browser gets multiple A records for a given hostname (say ip1 and ip2), and one of them is not accessible.
I interested in EXACT details, like (but not limited to):
- Will browser get 2 IPs from OS, or it will get only one ?
- Which ip will browser try first (random or always the first one) ? Now, let's say browser started with the failed ip1
- For how long will browser try ip1 ?
- If user hits "stop" while it waits for ip1, and then clicks refresh
- which IP will browser try ?
- What will happen when it times-out - will it start trying ip2 or give error ? (And if error, which ip will browser try when user clicks refresh).
- When user clicks refresh, will any browser attempt new DNS lookup ?
Now let's assume browser tried working ip2 first.
- For the next page request, will browser still use ip2, or it may randomly switch ips ?
- For how long browsers keep IPs in their cache ?
- When browsers sends a new DNS request, and get SAME ips, will it CONTINUE to use the same known-to-be-working IP, or the process starts from scratch and it may try any of the two ?
Of course it all may be browser dependent, and may also vary between versions and platforms, I'd be happy to have maximum of details.
The purpose of this - I'm trying to understand what exactly users will experience when round-robin DNS based used and one of the hosts fails.
Please, I'm NOT asking about how bad DNS load balancing is, and please refrain from answering "don't do it", "it's a bad idea", "you need heartbeat/proxy/BGP/whatever" and so on.
© Server Fault or respective owner