Mar 6, 2022


This week I read:


My DNS server has moved on quite a bit since last week. Back then it couldn’t even recursively resolve names: now it can! Here’s a summary of the changes:

I could actually use it for my home DNS now, as a replacement for my Pi-hole: the last blocker for using existing DNS blocklists was hosts file support and that’s there now.

Before I switch over though I want to add support for zone files, so that I can read the root.hints file. Currently I specify the IPs directly in a configuration file:

  - ""     # a.root-servers.net
  - ""   # b.root-servers.net
  - ""    # c.root-servers.net
  - ""    # d.root-servers.net
  - "" # e.root-servers.net
  - ""    # f.root-servers.net
  - ""   # g.root-servers.net
  - ""  # h.root-servers.net
  - ""  # i.root-servers.net
  - ""  # j.root-servers.net
  - ""   # k.root-servers.net
  - ""    # l.root-servers.net
  - ""   # m.root-servers.net

…but manually reading one configuration file to stick values into another isn’t a great workflow. They don’t change very often but, still, it’s not ideal.

Once I can read zone files, I’ll be able to use the root.hints file, and also specify custom records in the standard format, like:

$ORIGIN lan.

nyarlathotep      300    IN    A
*.nyarlathotep    300    IN    CNAME    nyarlathotep

Section 5 of RFC 1035 has the format. Annoyingly it’s not quite line-oriented: parentheses can be used to indicate a value extends over a multiple lines.

There are some other nice-to-haves, like dropping the config file entirely in favour of command-line arguments, improving logging, and reloading all the zone & hosts files with SIGHUP. But those can come later.