ZeroNS provides names that are a part of ZeroTier Central's configured networks; once provided a network it:
/etc/resolv.conf
resolvers that do not match the TLD, similar to dnsmasq
..domain
is the default), as well as configuring A
(IPv4) and AAAA
(IPv6) records for:
zt-<memberid>.<tld>
will resolve to the IPv4/v6 addresses for them.<name>.<tld>
.Please obtain a working rust environment first.
cargo install --git https://github.com/zerotier/zeronsd --branch main
Setting ZEROTIER_CENTRAL_TOKEN
in the environment is required. You must be able to administer the network to use zeronsd
with it. Also, running as root
is required as many client resolvers do not work over anything but port 53. Your zeronsd
instance will listen on both udp
and tcp
, port 53
.
Tip: running sudo
? Pass the -E
flag to import your current shell's environment, making it easier to add the ZEROTIER_CENTRAL_TOKEN
.
zeronsd start <network id>
You must have already joined a network and obviously, zerotier-one
should be running!
It should print some diagnostics after it has talked to your zerotier-one
instance to figure out what IP to listen on. After that it should communicate with the central API and set everything else up automatically.
-d <tld>
will set a TLD for your records; the default is domain
.-f <hosts file>
will parse a file in /etc/hosts
format and append it to your records.-s <secret file>
path to authtoken.secret
which is needed to talk to ZeroTier on localhost. You can provide this file with this argument, but it is auto-detected on multiple platforms including Linux, OS X and Windows.-t <central token file>
path to file containing your ZeroTier Central token.Records currently have a TTL of 60s, and Central's records are refreshed every 30s through the API. I felt this was a safer bet than letting timeouts happen.
ZeroNS demands a lot out of the trust-dns toolkit and I personally am grateful such a library suite exists. It made my job very easy.
Erik Hollensbe github@hollensbe.org