I want to know how this is handles or if there is a standard?
A DNS server with round-robin enabled will have multiple different A records, each with the same domain name but a different IP address. Each time the DNS server is queried, it sends the IP address to which it most recently responded with to the back of the queue, operating on a loop.
So for hostname to IP address mapping, you only get one IP address per hostname (but multiple hostnames could resolve to the same IP address, which is the opposite).
No, every host name can have multiple DNS A records pointing to different IPs. This is often used for high-level load balancing.
You can do it. That is what big guys do as well. As you see, the list of IPs rotated around, but the relative order between two IPs stayed the same. Update: I see several comments bragging about how DNS round-robin is not convenient for fail-over, so here is the summary: DNS is not for fail-over.
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 thenetwork.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With