### Start zeronsd via Command Line Source: https://github.com/zerotier/zeronsd/blob/main/README.md Basic command to start the zeronsd service for a specific network. ```bash zeronsd start ``` -------------------------------- ### Install ZeroNSD via Cargo Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Install necessary system dependencies before building and installing the binary via Cargo. ```bash sudo /usr/bin/apt-get -y install net-tools librust-openssl-dev pkg-config cargo sudo /usr/bin/cargo install zeronsd --root /usr/local ``` -------------------------------- ### Install and Join ZeroTier Network Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Installs the ZeroTier service and joins a specific network ID. Ensure the network ID is replaced with your own. ```bash notroot@ubuntu:~$ curl -s https://install.zerotier.com | sudo bash notroot@ubuntu:~$ sudo zerotier-cli join af78bf94364e2035 notroot@ubuntu:~$ sudo zerotier-cli set af78bf94364e2035 allowDNS=1 ``` -------------------------------- ### Install ZeroTier Systemd Manager Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Downloads and installs the systemd manager package for Linux systems. ```bash wget https://github.com/zerotier/zerotier-systemd-manager/releases/download/v0.1.9/zerotier-systemd-manager_0.1.9_linux_amd64.deb sudo dpkg -i zerotier-systemd-manager_0.1.9_linux_amd64.deb ``` -------------------------------- ### Start zeronsd with custom records Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Run the zeronsd server in the foreground using a token file, a custom hosts file, and a specified TLD. ```bash $ zeronsd start -t /var/lib/zerotier-one/token -f ./hosts -d beyond.corp Welcome to ZeroNS! Your IP is 1.2.3.4 ``` -------------------------------- ### Install ZeroNSD via Debian Package Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Use wget to download the specific version and install it using dpkg. ```bash wget https://github.com/zerotier/zeronsd/releases/download/v0.1.7/zeronsd_0.1.7_amd64.deb sudo dpkg -i zeronsd_0.1.7_amd64.deb ``` -------------------------------- ### Development Commands Source: https://github.com/zerotier/zeronsd/blob/main/README.md Commands for building and managing the development environment. ```bash nix flake develop ``` ```bash nix flake build ``` ```bash just docker-build ``` ```bash just --list ``` -------------------------------- ### Create a custom hosts file Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Define custom DNS mappings in a file using the standard hosts format. ```text 1.1.1.1 cloudflare-dns ``` -------------------------------- ### Supervise and Enable ZeroNSD Service Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Configure the service for a specific network ID and manage it via systemd. ```bash sudo zeronsd supervise -t /var/lib/zerotier-one/token -w -d beyond.corp af78bf94364e2035 sudo systemctl start zeronsd-af78bf94364e2035 sudo systemctl enable zeronsd-af78bf94364e2035 ``` -------------------------------- ### Check system resolver settings Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Displays current system DNS resolver configuration on OSX. ```bash scutil --dns ``` -------------------------------- ### Test /etc/hosts resolution Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Verifies that entries added to /etc/hosts are resolved correctly by ZeroNSD. ```bash bash -c 'echo "1.2.3.4 test" >> /etc/hosts' dig +short @172.22.245.70 test.beyond.corp 1.2.3.4 ``` -------------------------------- ### Restart ZeroTier Services Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Reloads systemd configurations and enables the ZeroTier systemd manager timer. ```bash sudo systemctl daemon-reload sudo systemctl restart zerotier-one sudo systemctl enable zerotier-systemd-manager.timer sudo systemctl start zerotier-systemd-manager.timer ``` -------------------------------- ### Configure ZeroTier API Token Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Saves the ZeroTier Central API token to a secure file location for ZeroNSD access. ```bash sudo bash -c "echo ZEROTIER_CENTRAL_TOKEN > /var/lib/zerotier-one/token" sudo chown zerotier-one:zerotier-one /var/lib/zerotier-one/token sudo chmod 600 /var/lib/zerotier-one/token ``` -------------------------------- ### Configure Zsh Host Completion Source: https://github.com/zerotier/zeronsd/blob/main/contrib/README.md Appends ZeroTier hostnames to the zsh completion system by reading from generated host files. ```sh # get current hosts. zsh builtin stuff uses /etc/hosts, ~/.ssh/known_hosts, etc... zstyle -s ':completion:*:hosts' hosts _hosts_config # append hosts from zeronsd [[ -r ~/.hosts ]] && _hosts_config+=($(cat $HOME/.hosts/hosts-*)) zstyle ':completion:*:hosts' hosts $_hosts_config ``` -------------------------------- ### Query DNS using dns-sd Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Uses dns-sd to query records on Ubuntu and OSX. ```bash dns-sd -G v4 server.beyond.corp dns-sd -G v4 zt-3513e8b98d.beyond.corp dns-sd -G v4 laptop.beyond.corp dns-sd -G v4 zt-eff05def90.beyond.corp ``` -------------------------------- ### Update ZeroNSD flag settings Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Configures the TLD and supervises the network ID. Requires root privileges to manage systemd services. ```bash sudo zeronsd supervise -t /var/lib/zerotier-one/token -w -d beyond.corp af78bf94364e2035 sudo systemctl daemon-reload sudo systemctl enable zeronsd-af78bf94364e2035 ``` -------------------------------- ### Query DNS on Ubuntu Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Uses dig to perform DNS lookups against the ZeroNSD server. ```bash dig +short @172.22.245.70 zt-3513e8b98d.beyond.corp 172.22.245.70 dig +short @172.22.245.70 server.beyond.corp 172.22.245.70 ``` -------------------------------- ### Verify DNS Functionality Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Test DNS resolution by pinging a device using its assigned domain name. ```bash notroot@ubuntu:~$ ping laptop.beyond.corp PING laptop.beyond.corp (172.22.192.177) 56(84) bytes of data. 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=1 ttl=64 time=50.1 ms 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=2 ttl=64 time=49.5 ms 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=3 ttl=64 time=48.6 ms ``` ```bash notroot@ubuntu:~$ ping laptop.beyond.corp PING travel.laptop.beyond.corp (172.22.192.177) 56(84) bytes of data. 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=1 ttl=64 time=50.1 ms 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=2 ttl=64 time=49.5 ms 64 bytes from 172.22.192.177 (172.22.192.177): icmp_seq=3 ttl=64 time=48.6 ms ``` -------------------------------- ### Copy ZeroTier Auth Token Source: https://github.com/zerotier/zeronsd/blob/main/contrib/README.md Copies the ZeroTier authentication token to the home directory to allow non-sudo access to zerotier-cli on Linux. ```sh sudo cp /var/lib/zerotier-one/authtoken.secret ~/.zeroTierOneAuthToken sudo chown $(id -u):$(id -g) ~/.zeroTierOneAuthToken ``` -------------------------------- ### Query custom DNS records Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Verify the custom record resolution using the host command against the zeronsd server IP. ```bash $ host cloudflare-dns.beyond.corp 1.2.3.4 cloudflare-dns.beyond.corp has address 1.1.1.1 ``` -------------------------------- ### Query DNS on OSX Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Uses dig to perform DNS lookups from an OSX client. ```bash dig +short @172.22.245.70 zt-eff05def90.beyond.corp 172.22.245.70 dig +short @172.22.245.70 laptop.beyond.corp 172.22.192.177 ``` -------------------------------- ### Verify public DNS fall through Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Checks that queries for public domains are correctly forwarded. ```bash dig +short @172.22.245.70 example.com 93.184.216.34 ``` -------------------------------- ### Ping host on OSX Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Uses ping to verify connectivity as standard DNS tools may be unreliable on OSX. ```bash user@osx:~$ ping server.beyond.corp PING server.beyond.corp (172.22.245.70): 56 data bytes 64 bytes from 172.22.245.70: icmp_seq=0 ttl=64 time=37.361 ms 64 bytes from 172.22.245.70: icmp_seq=1 ttl=64 time=38.129 ms 64 bytes from 172.22.245.70: icmp_seq=2 ttl=64 time=37.569 ms ``` -------------------------------- ### Run zeronsd in Docker Source: https://github.com/zerotier/zeronsd/blob/main/README.md Command to run zeronsd within a Docker container using host networking. ```bash docker run --net host -it \ -v /var/lib/zerotier-one/authtoken.secret:/authtoken.secret \ -v :/token.txt \ zeronsd:alpine start -s /authtoken.secret -t /token.txt \ ``` -------------------------------- ### Manual Nmap Host Extraction Source: https://github.com/zerotier/zeronsd/blob/main/contrib/README.md Command to manually extract hostnames from a ZeroTier network subnet using nmap. ```sh nmap -sL $SUBNET -oG - --dns-server=$SERVER | grep -v "()" | grep Host: | cut -d "(" -f2 | cut -d ")" -f1 > $OUTDIR/hosts-$NETWORK_ID ``` -------------------------------- ### Manage zeronsd as a Systemd Service Source: https://github.com/zerotier/zeronsd/blob/main/README.md Commands to enable or disable zeronsd as a systemd service on Linux or macOS. ```bash # to enable zeronsd supervise -t ~/.token -f /etc/hosts -d mydomain 36579ad8f6a82ad3 # generates systemd unit file named /lib/systemd/system/zeronsd-36579ad8f6a82ad3.service systemctl daemon-reload systemctl enable zeronsd-36579ad8f6a82ad3.service && systemctl start zeronsd-36579ad8f6a82ad3.service # to disable systemctl disable zeronsd-36579ad8f6a82ad3.service && systemctl stop zeronsd-36579ad8f6a82ad3.service zeronsd unsupervise 36579ad8f6a82ad3 systemctl daemon-reload ``` -------------------------------- ### Find ZeroNSD bound IP address Source: https://github.com/zerotier/zeronsd/blob/main/docs/quickstart.md Identifies the IP address currently bound by the zeronsd process for manual DNS testing. ```bash sudo lsof -i -n | grep ^zeronsd | grep UDP | awk '{ print $9 }' | cut -f1 -d: 172.22.245.70 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.