Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My company uses CloudFlare for its DNS, but as our site is HTTPS-secured and we're on the free plan, we can't utilize CloudFlare's CDN services.

Our host has fairly rare but not insignificant downtime. We can't migrate servers just yet, and I'd like to be able to either have the main domain redirect to the status domain, or simply resolve to the alternative status host in the event of downtime so users will stop bugging me asking if the site is down.

Is this possible to do automatically using the free CloudFlare plan, or will I have to manually edit my DNS every time the site goes down?

share|improve this question
Manually editing your DNS won't help since visitors DNS cache and root zone records may not be updating as quickly as you'd hope. Visitors will still get errors if your site is down. Why can't you migrate servers? There are so many options and i'm sure plenty all within your price range for hosting. If your host is going down that often that you're asking about this. I'd like for a new host. – Anagio Oct 29 '13 at 8:25
@Anagio CloudFlare's TTL is 5 minutes, so DNS changes are propagated rather quickly. We are unable to switch providers because we also host online gaming servers, and moving providers means that we would have to change our IP addresses. Because our users' favorites lists are stored by IP and not domain, it would be devastating to our player base. – Dr. McKay Oct 29 '13 at 17:09
up vote 3 down vote accepted

I've had a similar problem before and have solved it using CloudFlare's API. I had a Dedicated server and a large VPS for backup. Mirrored the data on the two servers, and used CloudFlare to switch between them (DNS Failover) if the Dedicated went down. Initially did reboots via SSH/IPMI to verify and it worked as configured.

Here's the link to the article: http://blog.booru.org/?p=12

share|improve this answer
Is this your blog? If so, please indicate that in your answer as a disclaimer. – dan Dec 24 '13 at 5:39

There is automated solution for this written in the programming language Go, it can be found at GitHub (https://github.com/rasmusj-se/cloudflare-failover).

To use this you will have to do a couple of things:

  1. Pull or download the repository and it's dependencies
  2. Install Go and build the project
  3. Extract your CloudFlare API key and add this to the configuration file "cloudflare.conf".
  4. Setup your endpoint check, primary and backup server destination in the folder "cecks/", see "example.com.conf" for example config.
  5. Run the program at a dedicated server or at your backup server
share|improve this answer
Welcome to Pro Webmasters. Thank you for disclosing your affiliation with your link. Keep in mind that this site cannot be used only to promote your work. Further self promotional posts without other types of contributions are not allowed. – Stephen Ostermiller Feb 29 at 10:35
Post updated to not reflect own afiliation in the project at GitHub, this is simply a solution to the problem not a way to endorse my project specifically. – rasmusj.se Mar 1 at 12:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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