Setup DNS Service
I've decided to set up and manage my own nameservers. Why? you might ask. These days there are so many third-party DNS solutions around, and indeed I have been making use of one of them, DNSMadeEasy, to run DNS for a bunch of servers I maintain for my wife's property website. With the current intended audience predominantly based in only one country, I can make use of their round robin and failover service. Bear in mind though this is limited to a maximum of only five A records for any one service.
The main reason behind my adventure is the expansion into European countries which conveniently offers me a flimsy excuse to do a bit of hacking. This will produce a working geo-dns solution. UK visitors will be directed to servers in the UK, and vistors from France, Spain and Italy (maybe other countries also of course) will be directed to servers based in Europe (Amsterdam to be precise).
This does lead me to wonder about the failover aspects of it all. I'd obviously lose that if I simply managed my own DNS and did nothing else. The service I currently use does remove the A records of any failed server from DNS. Not an ideal solution as due to TTL and caching issues, if a server did fail, it wouldn't go unnoticed by some visitors to the site, but hopefully this would only be for a short time. It's a compromise between an inexpensive DNS product and how much inconvenience I'm prepared to put up with.
There are several technical solutions I can make use of to do this, each involving different DNS software. Only two of them currently interest me, and I'll detail both solutions in separate posts.
The question is, can I get my nameserver built and running in 30 minutes? The answer to the question is yes (approximately). Hopefully after reading the next post in this series, you'll be able to do it too. I've done this on an OpenBSD laptop (runs OpenBSD 4.3). So FreeBSD should work just the same, and in fact any variety of Linux will work with some change to the software startup scheme. But I don't think that would really phase any serious Linux users at all.
It may seem overkill perhaps, but I keep ephemeral data (not only session data) on separate servers. Bouncing users around between servers in London and Amsterdam would require some data replication between both locations which adds complexity where it isn't really required - especially as geo-dns is so trivial to implement.
To provide some resilience I'll show in a later post how to swap-out failed webservers, and also how to add them back when they're back in business. This will be automated so if a server is down all you need to do is have a look, and if you fix any issue and bring it back online, it will be detected and automatically added back into the DNS rotation.

