Skip to main content
These commands do what DNS → Zones and DNS → Views do in the dashboard. For what zones, records and views are, see Zones and records, Import and export and Views.

Zones

Zones are named by name or id. When you belong to several divisions, commands that create something need --division (-d), given as id, slug or name.

Default TTL

Records added without a TTL get the zone’s default TTL, 300 seconds unless you change it:

Import and export

zone import adds records from a BIND zone file and shows a preview first. --dry-run only shows what would change; --replace deletes the zone’s current records first. Use - as the file name to read from standard input. zone export prints to standard output unless you give -o.

Turning a zone off

dnz zone set example.com --enabled off does the same as disable.

Forwarding names a zone doesn’t have

--forward-missing is on by default. It lets a local zone override a few names of a public domain: names and record types the zone doesn’t have are forwarded to the upstreams instead of answered with NXDOMAIN or NODATA. Turn it off for a zone that is the whole truth for its domain.
DNSSEC-signed zones can’t forward: turning DNSSEC on turns forwarding off. Secondary zones never forward.

DNSSEC and secondary zones

See DNSSEC and Replication.

Records

Picking records

Commands that change records pick them in one of three ways:
  • by name, type and (optionally) value: dnz record rm example.com www A 192.0.2.11
  • by id: --id 42, or several with --id 4,7 (ids are in dnz record list)
  • by tag: --tag legacy (repeat for several; a record must carry all of them)
Names may be relative (www, @ for the apex) or full (www.example.com.). When more than one record matches, the command lists them and stops. Narrow it down, or pass --all to act on every match.

Listing

Adding

Put -- before a value that starts with a dash.

Changing

record edit takes --rename, --value (alias --to), --ttl, --priority, --view, --comment, --enabled on|off, --add-tag, --remove-tag and --proxy.

Deleting

Proxied records

--proxy puts an A, AAAA or CNAME record behind one or more proxies, like Cloudflare’s orange cloud. DNS then answers the name with every proxy’s address. Each proxy needs a router for the name (see Proxy routing, or let dnz proxy route set it up).
A name’s A, AAAA and CNAME records must go through the same proxies, so change them together: leave out the type and pass --all.

Traffic steering

record steer sets GeoDNS, a weight and a health check on A and AAAA records; record steering lists a zone’s steered records and their health. See GeoDNS and health checks.
Records are picked the same way as for other record commands (name, type and value, --id, --tag, --all). --countries, --continents and --weight none replace what was set; flags left out keep it. The check options need a check, so add --check first (or in the same command).

GeoIP database

GeoDNS places clients with a country database. These commands need a superadmin, except lookup.
--url takes a .mmdb or .mmdb.gz URL; {year} and {month} are filled in. --auto-update on downloads it again every month. See Where clients are.

Many records at once

record add-many adds many records with one value, for example many subdomains on one IP. Every name gets the shared value, and a line of --file may carry its own value after the name.
A names file holds one name per line, or several separated by commas. # starts a comment:
hosts.txt
The shared value is optional when every line has its own. add-many also takes --ttl, --priority, --view, --comment, --tag, --proxy and --disabled, applied to every record. --dry-run shows the records without adding them.
The records are added together, or none at all if one fails: a duplicate, a CNAME clash, a bad value.

Tags, comments and turning records off

Records can carry a comment and tags, and can be turned off without deleting them. A disabled record is kept, but not answered, transferred or signed.

How bulk changes work

A change to several records (--all, or several --ids) goes in one request that is checked as a whole and applied all or nothing, with one serial bump and one audit log entry. Only the TTL, comment, on/off and tags change in bulk. --value, --rename, --priority and --view change one record at a time. The API behind it is described in Bulk changes.

Views

Split-horizon views answer a name differently for some client networks. See Views.
Add records to a view with dnz record add … --view lan.