Skip to content

Zone files

dinio zone export, import and discover move records between a zone and a file. See DNS hosting.

Terminal window
dinio zone export example.com -f example.com.json
dinio zone import example.org example.com.json --dry-run
dinio zone import example.org example.com.json
--format File Carries
json Dinio’s dinio-zone document Records with their options, geo bans and health checks, and redirects. Names relative to the zone, so it also works as a template for another zone.
bind BIND zone file Name, TTL, type and data.
csv CSV with a header row Name, TTL, type and data.

Without --format the CLI goes by the file extension: .json; .zone, .bind or .db; .csv. The document is described on the API page.

Writes the zone to stdout, or to a file with -f PATH (it asks before overwriting one). Default format: from the file’s extension, else json.

Terminal window
dinio zone export example.com --format bind > example.com.zone

json leaves out the apex SOA/NS and the records Dinio keeps; bind and csv include them, except _acme-challenge records. Certificates are never exported.

Adds what the zone doesn’t have yet: nothing in the zone is changed or deleted, and the SOA and apex NS in the file are skipped. FILE can be - for stdin; then give --format.

The CLI first sends the file as a dry run and prints the report: how many records it would create, what is already in the zone, what it skips, warnings and errors, each with its line (or its entry, in a json file). Then it asks before importing.

records: 12 to create, 1 already in the zone or repeated, 1 skipped, 0 warning(s), 0 error(s)
skipped:
line 3 (example.org SOA): SOA at the apex stays the zone's own (our nameservers)
Import 12 record(s) and 0 redirect(s) into example.org? [y/N]
Option
--format json|bind|csv When the extension doesn’t tell.
--dry-run Only print the report.

Records go in all or nothing: if Dinio refuses any record, nothing is imported and the command exits with 6. Redirects (from a json file) are created after the records, one by one; if some fail, the records stay imported, the failed redirects are listed, and the exit code is 6.

For a domain moving from another provider: Dinio asks the zone’s current nameservers about the names a zone usually has and proposes what it finds. It takes up to a minute and changes nothing.

Terminal window
dinio zone create example.com
dinio zone discover example.com -f proposal.json
# edit proposal.json: remove what you don't want
dinio zone import example.com proposal.json
Option
-f, --file PATH Write the proposal (a dinio-zone document) to a file. Without it, the records are printed as a table.
--ns NAMESERVER Ask this nameserver — the previous provider’s — instead of the delegation. Repeatable.

Once the domain’s delegation already points to Dinio, there is nobody left to ask, and discovery fails with a hint: give the previous provider’s nameservers with --ns.