Primary and Secondary DNS for a Subdomain

206 views Asked by At

I need to assign a secondary IP for a subdomain to redirect into. This is in case a first IP is not working.

Does creating multiple A records with the same name allow the browser to cycle through them in case one of them is not working?

1

There are 1 answers

0
Manish Maheshwari On

Multiple A records associated with a domain are in fact the basis of DNS round robin load balancing.

However, do not confuse this with automatic failover. If one of the IP addresses is not working, then the browser(which is a client) would not automatically retry the others.

So which IP would a browser use? Well, the nameservers return the A records in different order at different times, to a querying client. Typically, the client just uses the first A record value that it gets. Further, the client would not query again until the TTL expires for that A record. All this querying of the nameservers, and caching until TTL is managed by a component called stub resolver, which works on request from browser.