DNS failover across multiple datacenters

domain-name-systemfailoverhaproxy

I've got a site that is starting to get a lot of traffic and just the other day, we had a network outage at the datacenter where our loadbalancer (haproxy) is hosted at.
This worried me as despite all my efforts of making the system fully redundant, I still could not make our DNS redundant, which I think isn't an easy solution.

Only thing I was able to find was to sign up for DNS failover from places like dnsme, etc …. but they cost too much for budding startups. Even their Corporate plan only gives you 50 million queries per month and we use that up in a week.

So my question is, are there any self hosted DNS we can do that provides the failover like how dnsme does it?

Best Answer

DNS is designed for redundancy. Setup two bind servers at seperate datacenters. Set one to be the slave of the other. Make sure both are listed at your domain registrar. Done.

Here's a randomly selected guide on setting up a slave server: http://docstore.mik.ua/orelly/networking_2ndEd/dns/ch04_08.htm

Ok, you're looking for failover by switching your A record to a different IP address. That's pretty easy to do as well if you are using BIND for your name servers. You can write a script that will call nsupdate to add/delete/change your DNS records. Whatever clustering or monitoring systems you use can check if your loadbalancer is inaccessible and change the DNS record to point to one that still works, or if using round robin dns to remove failed nodes and add then back in when they come back up.