0

I have three Shared Hosting Servers (2 Linux Apache and 1 Windows)

For my (low traffic) static websites, I want to create mirror server accounts (will keep same contents) for them so I need not to bother if any of the server is down.

Load balancing is not needed but need to provide priority to one particular server.

The domain registration provider allows me to set the A-records as many as I want but does not allow me to set up any priority among A records.

Question: How can it be prioritized ? -

(Using any independent service (free)? or using DNS zone settings at servers and setting up long TTLs?)

Please note that for E-mail accounts (routing) I have different set up of MX-records.

1 Answer 1

1

The simplest way to do it is just to create multiple A records. The first A record will be the primary server, the others will be the backups. Most modern browsers should attempt the subsequent IP addresses if the first one fails.

This is a bit like a round-robin DNS but without the IP addresses being rotated for load balancing. Normally for round-robin and similar DDNS setups, you use a short TTL, otherwise you can't change the IP visitors go to when the main server is detected to be down. But if you're not using DDNS, and you just have a fixed list of primary, secondary, tertiary, etc. servers you want clients to try, then, yes, just set a long TTL as you'd normally do for optimal DNS efficiency.

Note: the drawback of this simple method is that, if your primary server is down, the client will still attempt to connect to the primary server first. It will only try to connect to the second server once the first connection fails/times out. And if the second server is also down, then that'll add a delay too. This can make the page load very slow initially (until the host IP of the successful connection is cached). This is why there are more advanced DNS/DDNS failover services out there, where they actively monitor your servers to see if one is down, and modify your DNS records on the fly as appropriate.

For more advanced failover techniques, you should use a specialized DNS hosting service or try cloud hosting or CDNs, the latter of which you don't actually have to do anything yourself, as those infrastructures are designed to be redundant and provide failover protection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.