dnz binary.
Without a command, dnz runs the server. Every other command manages a running server through its
HTTP API.
Because the CLI goes through the API:
- it follows the same permissions as the dashboard,
- it validates input the same way,
- every change shows up in the audit log under your name.
A quick example
dnz login signs you in to this machine’s server and saves the session, so the next commands need
no password. See Authentication.
Getting help
dnz --help lists every command, and dnz <command> --help lists every option of a command:
dnz zones list works as well as dnz zone list.
Shorter aliases exist too: fwd for forwarding, repl for replication, cf for
cloudflare, ls for list and delete for rm.
Options every command takes
Output
Commands print tables. Add--json to get the API’s JSON instead, for example to feed jq:
--yes (-y) skips the question.
Which server a command talks to
The CLI picks the server in this order:--serverDNZ_SERVER- the last server you signed in to
- this machine’s
http.addrfrom the config file
dnz login with no options is usually all you need. From your laptop,
sign in once with --server and later commands go to that server.
Running without the web UI
DNZ can run headless, managed only from the CLI and the API. Turn the UI off in one of three ways:http.addr (default 127.0.0.1:8080, so only this
machine can reach it), and / answers that the UI is off.
First-run setup from the terminal
On a new server with no users yet, create the first admin withdnz setup:
DNZ_PASSWORD:
Commands
Authentication
Sign in, API tokens for scripts, private CAs and sessions.
Zones and records
Zones, records, bulk changes, tags and views.
Access
Divisions, users, roles, API tokens and update keys.
Forwarding
Upstreams, strategies, rules and diagnosis.
Filtering
Blocklists, rules and client networks.
Replication
Primary and secondary servers, join codes.
Proxy
Proxy routes and dnz-proxy nodes.
Cloudflare
Connect, import and push zones.
Notifications
Telegram, email and webhook providers, alert thresholds.
Monitoring
Query log, stats, audit log, topology and settings.
Maintenance
Configuration, health checks, version and factory reset.