farblog

by Malcolm Rowe

Cloudy DNS

This is a machine running on the end of an ADSL line. It’s not a very happy machine:

$ uptime
 11:28:01 up 781 days,  1:39,  1 user,  load average: 2.01, 2.03, 2.05

It’s actually idle, so why is the load average above 2.0? Because there’s an unkillable mdadm process stuck in a D state, and a second mount process that’s permanently runnable.

So why haven’t I just rebooted it (and better still, upgraded it: obviously it’s running an old kernel)? Because I’m not entirely convinced it’ll start up again: the disks were acting a bit suspiciously, and lately the PSU fan has been making a bit of a racket as well.

Unfortunately, it’s also a machine that’s accumulated infrastructure that I care about: DNS, Apache, and so on. The data is safely backed up off-machine, but if I just tear it down, a bunch of things will be broken while I’m rebuilding it. So instead, I’ve been trying to decommission it piece-by-piece.

I’ve also got a bit bored running all my own infrastructure, so some of those moving parts have been put onto dedicated consumer hardware (getting the router to handle internal DNS and DHCP, getting a Synology NAS for Samba, etc), and I’ve moved some others onto a hosted VM, so that I don’t have to worry about the hardware: that copy of Apache has been (mostly) obsoleted by moving this site to Google Compute Engine last January, for example.

But there’s still a few things that I’m depending upon this machine for. Until recently, one was as the primary DNS server for farside.org.uk.

I was using a free secondary DNS service from BuddyNS: they provide replicas that I listed as the primaries, and those did regular zone transfers from my server for the source of truth.

That was pretty convenient, and BuddyNS have been pretty great (the free tier is good for up to 300K queries per month, of which I was using about 70-100K), but they only provide secondary DNS, so I went looking for another solution.

I’m sure that there are many other DNS providers around, but since I’m hosting www.farside.org.uk on Google Compute Engine, I decided to try out Google Cloud DNS, which provides a simple primary DNS service, available via anycast over both IPv4 and IPv6 (that arrangement seems to be fairly standard for DNS providers nowadays).

This one’s not free, but it is pretty cheap: US$0.20/month per domain, plus US$0.40/month per million queries. For me, that should work out to less than $3/year1.

Otherwise, it seems to be broadly similar to other DNS providers. You can make updates via a JSON/REST API, and API client libraries and a basic command-line client are provided. They do only support a predefined set of resource record types, though I suspect that’s not a problem for most people2.

I actually switched a few weeks ago, but until very recently the programmatic REST API was the only way to make changes, so this wasn’t really a product I’d want to recommend: technically, it worked, but editing a JSON document by hand to send via the command-line client was… suboptimal.

Fortunately, there’s now an editor embedded in the Google Developers Console, so you can also make changes interactively.

The Google Cloud DNS editor lists
individual resource records, along with facilities for in-place editing,
creation and deletion.
The new Cloud DNS editor in the Google Developer Console

Overall, I’m happy enough with the switch: it seems to work well, and didn’t take much effort (once I’d remembered to quote my TXT strings properly, ahem).

I did make one or two changes to the domain at the same time, most notably removing the A record for farside.org.uk itself (which had originally been present for direct mail delivery, years ago). This does mean that http://farside.org.uk/ will no longer resolve3, but that hopefully shouldn’t cause any real problems.


  1. Full disclosure: I’m currently getting an employee discount, so I’ll be paying less than that. 

  2. I did have to drop an RP RR as a result of this, though I wasn’t actually using it for anything. 

  3. Previously, this would end up at the aforementioned machine and be redirected by that copy of Apache to www.farside.org.uk, which runs elsewhere.