Zone files
dinio zone export, import and discover move records between a zone and a file. See
DNS hosting.
dinio zone export example.com -f example.com.jsondinio zone import example.org example.com.json --dry-rundinio zone import example.org example.com.jsonFormats
Section titled “Formats”--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.
zone export ZONE
Section titled “zone export ZONE”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.
dinio zone export example.com --format bind > example.com.zonejson leaves out the apex SOA/NS and the records Dinio keeps; bind and csv include
them, except _acme-challenge records. Certificates are never exported.
zone import ZONE FILE
Section titled “zone import ZONE FILE”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.
zone discover ZONE
Section titled “zone discover ZONE”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.
dinio zone create example.comdinio zone discover example.com -f proposal.json# edit proposal.json: remove what you don't wantdinio 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.