Setting up DNS on ZT network

I’m making a webserver, and I can’t open ports, so I’m falling back to ZT. ZeroTier works, as expected. I can connect to the other machines on the network, and I can connect to the server via its ZT IP.

Well, I want to give it a name, so I can type that instead of the IP. I went into the server’s /etc/hosts file (it’s running Arch Linux) and added one line, just to test:

As expected, from the server itself I can type ping and it gets indeed redirected to itself. Great.

Now, I go into the zerotier web UI, and add to the search domain, and the ZT address for the server into the server address.

The way I understand it, when a PC on this ZT network tries to ping, ZT will recognize that, and will redirect to the server for it to resolve. Since the server is configured via /etc/hosts to redirect to itself, the server should resolve to itself, and it should just work.

But unfortunately, it does not work. I can ping the server directly via the ZT ip from other computers, but not via this domain.

I do have enabled “Allow Default Route”, “Allow Global IP”, “Allow Managed IP” AND “Allow DNS Configuration”. Everything is enabled both in the server and in the clients (I do not know how to enable this in Android clients tho).

Any clues? How can I make this work?

Thanks for asking. You don’t need any of those allow options, except for Allow Managed.

Setting Allow DNS will let zerotier set up a DNS configuration on mac, windows, and mobile.

I think the missing piece is you need a DNS server running for that domain.

We built one for this purpose:

more info:

Hi, I actually didn’t mention it but I do have a DNS server setup there, dnsmasq. The thing is, I don’t want to do any extra setup on the clients apart from connecting to the ZT network, I don’t want to have to point to that DNS server. Can I do that on Linux clients and servers?

dnsmasq should be able to work for that. Put “domain:, servers: zerotier-ip-of-dnsmasq-server” into the zerotier network config.

for linux clients you need this service

I see, thank you.

But what about Android clients? Shouldn’t that work automatically? I can’t ping the server with the domain name I’ve setup on the DNS. Unless I’m misinterpreting something, it should be automatic, right? (I have already configured the network to point DNS requests to the server).

Should work. Did you enable allow dns? I think you unfortunately have to delete the network from the phone and re add it to set that option.

There’s no allow DNS option on Android. There’s a DNS option, but it gives me a prompt to enter an IP address… which shouldn’t be necessary right? What should I enter there?

it says “Network DNS” or something. Sorry I’m not super familiar with the Android version.

Ok, I added the ZT IP for the DNS and it’s working now. Still nothing on Linux clients. The docs say support for Linux for this feature is coming. Is it?