Alexander’s topic (From Great Self-Hosting Platform to True Big-Tech Alternative) brought this to mind, but it’s somewhat orthogonal, so I figured a separate topic was best.
The road so far
About two months ago, as a side quest from automx, I decided to build a tool that would let automx manage its own DNS records, and thus, dnshelper was born, letting modules on your NS8 cluster control their own DNS records on 17 different hosts and counting. (and also giving a full-featured zone editor for any zones it manages, uniform across backend DNS hosts).
It was a pretty natural progression from that to hosting your own public DNS (as requested by @giacomo among others), which led to powerdns. Primary and secondary DNS, replicating automatically across your cluster, driven by dnshelper, which picks it up automatically. It does DNSSEC, it tells you what records to create at your registrar, and it can now replicate to external secondaries as well.
The last piece was @oneitonitram’s suggestion of an API, so that tools outside the cluster could drive dnshelper. I was initially skeptical of the value of this (the MSP world just isn’t where I live), until I realized it would solve one of the blockers preventing me from “eating my own dog food:” DNS validation for ACME certificates. A number of hosts/services on my LAN get Let’s Encrypt certificates this way, and without such an API, I couldn’t use my own solution. Thus convinced, I had a bit of a chat with Claude, and dnsapi was the result. Claude was even clever enough to implement an API that some popular ACME clients (acme.sh, lego, Caddy) already speak, and to come up with a simple script to let certbot use that API as well.
Where are we now?
Without ever really intending to, I seem to have developed a little ecosystem around dnshelper. And while it no doubt has room to grow and bugs and kinks to work out, I think all the big pieces are there to now let NS8 serve as a full-featured public DNS host:
This has nothing to do with local DNS; dnsmasq and other modules handle that side of things. But on the public side, I think it’s pretty much there.
Call to action
“Call to action” sounds awfully forceful, but there are a couple of points where I’d like to ask for some engagement from the community, and especially from other module devs:
- Help me build out dnshelper. If you use a DNS host that dnshelper doesn’t already support, and it has an API, I’d appreciate your help in adding support for that host to dnshelper. If you can give me API credentials for a couple of hours, along with a zone you don’t mind me using for testing, that should be enough to code and test an adapter.
- Consider using dnshelper in your own modules. If your module deals with DNS in any way (and they almost all do), I’d ask that you code your modules to be able to work with it, as automx does–automx does not require dnshelper, but will use it if it’s present.
- Does your module create a virtual host? That’s a DNS record, most often a CNAME to the primary FQDN of the server. Let dnshelper set up that record, rather than making your user log into a separate system to do it (and introducing the chance of a typo or other error). For bonus points, confirm the record is present before creating the Traefik route, ensuring that cert creation will succeed.
- Mail. This is the big one, as there are several records (including very long TXT records) called for by a mail server, and one typo can result in mail delivery failure. If the user has to touch it, there’s a chance he gets it wrong–so automate it. I realize mail is mission-critical to many organizations, so I don’t expect the devs will be in a hurry to change this, but I’d really encourage you to take a hard look at it.
- HPKP/TLSA/DANE - HPKP is pretty well deprecated at this point, but the other two are live. Especially if you’re pinning to leaf public keys (which you shouldn’t be), these need to be updated regularly–so automate it.
Conclusion
I didn’t really set out to build an end-to-end DNS solution for NS8, but as I look back at it, that’s pretty much where we are, and I think it’s an important piece of functionality. I’m looking forward to what else can be done with it.
