1

I currently have 2 servers with identical files for a number of websites in 2 different locations. One has fast internet access but is regularly offline whereas the other is always on and has slower internet access.

They are both on dynamic IPs so I use noip to get an address which then provides the static address for my domain names via a cname entry in the DNS table. The domains are managed by 123-reg and getting static IPs isn't an option.

Currently, I have to manually change the DNS records whenever the faster server is online to offer a faster connection. Obviously this is a time consuming job and with a TTL of 4 hours, a slow process.

Is there a way I can either set my DNS records to point to both dynamic DNS addresses and have it pick an active one (either randomly or with preference going to the faster connection) or have both servers update the same DDNS entry again, giving preference to the faster one but allowing the slower one to take over when its not available.

4
  • You can use DNSMadeEasy Aname records for this type of work. They will failover for you automatically, and you can set rules. Doing it alone with Cnames will not work. But you should really look at using something like a reverse proxy (preferabbly nginx) which can use the slow and fast servers as back end server and handle the failover for you.
    – Frank
    Commented Sep 19, 2014 at 8:47
  • Thanks for the reply. I was looking for a free option but I'll take a look at DNSMadeEasy. Can you expand on what you mean by a reverse proxy? The work around Im using at the moment is I have a RPi polling the two servers and doing the dns update to no-ip with the ip address of the preferred/on-line server. Its a bit messy so I'd rather not rely on it long term Commented Sep 25, 2014 at 9:05
  • A reverse proxy is a web server which pulls its content from other servers. Or you can use a strictly proxy like HAproxy. Eseentially what it does is pull content from multiple backend servers. It can check if a backend server is down, and if so pull content from a different backend server. Or it can act as a load balancer, or both. HaProxy runs on linux and is very easy to setup. NginX is a beast for reverse proxying but takes a bit more time to configure. You still have to worry about the reverse proxy going down, but if you had solid hosting it would be a safe way to go.
    – Frank
    Commented Sep 25, 2014 at 13:18
  • You can also Fail over and load balance reverse proxies, so if one is down, then the other takes its workload. For that you need something like an amazon AWS ip which can do failover for you, or DNS failover from a service like DNS made easy.
    – Frank
    Commented Sep 25, 2014 at 13:19

1 Answer 1

1

Without recommending a specific software or product which is off topic for this site what you are after is a health checking DNS service which regularly checks if the server is online and only returns the DNS record if it is online. Most of them can be configured in a fail over situation where the automatic health check will fall back to the alternate slower machine when the faster machine is offline.

1
  • Recommendations are great in answers as long as it helps answer the question, isn't the entire answer, and you disclose affiliations. Questions that ask for recommendations are off-topic. Commented Nov 8, 2016 at 13:51

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.