While I generally enjoy the idea of having an “internal” network for all my
computers, I’m not always on the same LAN as them. Further, I strongly dislike
recalling IP addresses. I found a tool that seemed to do the job,
ztdns, but it lacked a “Recursive Resolver”, which made tools like
nslookup very unhappy and led to downstream programs like NFS, Samba, AFP,
and TimeMachine to be touch-and-go in their reliability.
Initially, I wrote a script that would periodically update my
file1. The catch here is that
nslookup could care less about what
/etc/hosts knows. It wants a DNS server, which CoreDNS seemed an
Since I didn’t want to bother reconfiguring it across each machine, I wrote ZeroDNS – which synthesizes ZeroTier and CoreDNS into a container to provide a domain resolver for your ZeroTier peers.
How’s it work?
Zerodns uses a tool called
ztc to query the ZeroTier API. It then
parses the returned CSV and ultimately translates it into an
file (this will be stored in your
zerodns directory). This
hosts file is
what allows CoreDNS to reroute specific names to your peers. It locally
filters your traffic looking up against the
hosts file, passing all
non-member queries to the DNS you specify using
docker ... [[--dns <DNS>] ...].
If you’d like to further inspect functionality, you can do so here.
Ready to start?
Head to the documentation page to learn how to use ZeroDNS.
Which I actually did for a time, even with a
/etc/hostsonly works for the tools that respect it,
nslookupjust so happens to be one that doesn’t. ↩︎