Injecting DHCP options from Controller

I am specifically looking for some way to automatically add a ZT-network-specific DNS server (e.g.: zeronsd) whenever a host joins a network (and is authorized, of course).

I currently have a net and I start zeronsd with docker run -v /var/lib/zerotier-one:/var/lib/zerotier-one:ro -e ZEROTIER_CENTRAL_TOKEN=<mytoken> --net host --rm zerotier/zeronsd start <netid> -d <domain>.

This works well and I can resolve addresses using something like: host <host>.<domain> <ZT1 IP of server where zerosnd runs> but I have to manually modify /etc/resolv.conf (which will be rewritten by resolvconf) to get a global resolution. Surely this is not the “best practice”.

How am I supposed to handle this?
Is it possible to automate the process or should I act on each end all clients?

Note: servers and some clients are Linux machines, but I also have Windows clients.
Note2: I noticed DNS server appeared on https://my.zerotier.com/network/<netid>, but I still have no name resolution on clients.

Hello,
welcome to the forum. One Windows and Mac, there’s an “Allow DNS” checkbox that sets up the OS to use your (zeronsd) dns server automatically.

On linuxes that have systemd, there’s a little tool that can help GitHub - zerotier/zerotier-systemd-manager

Hope that helps!

Thanks zt-travis,
I seem unable to make it work though.

I installed it apparently without errors, but it doesn’t seem to make a difference:

mcondarelli@sb001:~/tmp$ host lenovo.soft-in.com 172.28.182.229
Using domain server:
Name: 172.28.182.229
Address: 172.28.182.229#53
Aliases: 

lenovo.soft-in.com has address 172.28.3.18
lenovo.soft-in.com has IPv6 address fc5d:f964:6f33:8ea0:572b::1
mcondarelli@sb001:~/tmp$ sudo dpkg -i zerotier-systemd-manager_0.2.1_linux_amd64.deb 
Selecting previously unselected package zerotier-systemd-manager.
(Reading database ... 249761 files and directories currently installed.)
Preparing to unpack zerotier-systemd-manager_0.2.1_linux_amd64.deb ...
Unpacking zerotier-systemd-manager (0.2.1) ...
Setting up zerotier-systemd-manager (0.2.1) ...
+ systemctl daemon-reload
+ systemctl enable zerotier-systemd-manager.timer
Created symlink from /etc/systemd/system/timers.target.wants/zerotier-systemd-manager.timer to /lib/systemd/system/zerotier-systemd-manager.timer.
+ systemctl start zerotier-systemd-manager.timer
mcondarelli@sb001:~/tmp$ ping lenovo.soft-in.com
ping: unknown host lenovo.soft-in.com
mcondarelli@sb001:~/tmp$ zerotier-systemd-manager
You need to be root to run this program
mcondarelli@sb001:~/tmp$ sudo zerotier-systemd-manager
"/etc/systemd/network/99-ztyqbt4opw.network" hasn't changed; skipping

What am I missing?

TiA!

I really can’t say. There are too many different ways to configure networking on too many linux distros.

You can look at resolvectl, networkctl, and the contents of /etc/systemd/network/99-ztyqbt4opw.network to maybe get some clues.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.