Import and Export
Move zones in and out of ScaiDNS using BIND zone files, JSON, or CSV. Useful for migrations, backups, and bulk edits.
Base path: /api/v1/domains/{domain_id}/import and /export
Required permission: records:create for import, records:read for export
Export#
Get a zone as a BIND-format text file:
1 2 | |
1 2 3 4 5 | |
1 2 3 4 5 6 | |
Response:
1 2 3 4 5 6 | |
Download as attachment#
For saving directly to a file:
1 2 3 | |
Returns the zone file as plain text with Content-Disposition: attachment; filename="example.com.zone".
Import#
Import creates records from a zone file, JSON, or CSV input. Three ways to provide the data:
Import from pasted text#
1 2 3 4 5 6 7 8 | |
Import from file upload#
1 2 3 4 5 | |
1 2 3 4 5 6 7 8 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Formats#
BIND#
Standard zone-file format. Parser handles $ORIGIN, $TTL, comments, and multi-line records:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
JSON#
Array of record objects:
1 2 3 4 5 | |
CSV#
Header row required; columns are name,type,content,ttl,disabled:
name,type,content,ttl,disabled
www,A,192.0.2.10,300,false
mail,A,192.0.2.20,300,false
@,MX,10 mail.example.com.,3600,false
Modes#
| Mode | Behavior |
|---|---|
replace |
Delete all existing records, then import. Destructive — existing records not in the import are lost |
merge |
Add new records; update existing ones where the (name, type, content) triple matches |
skip_existing |
Add new records only; leave anything that already matches alone |
Default is merge if unspecified. Use replace with care and only when you're sure the import is complete.
Preview before importing#
See what would happen without applying:
1 2 3 4 5 6 7 8 | |
Response:
1 2 3 4 5 6 7 8 9 10 | |
Always preview before a replace — the preview shows exactly what will change.
Response#
After an actual import:
1 2 3 4 5 6 7 | |
imported_count— records successfully created or updated.conflict_count— records skipped because of existing conflicts (only inskip_existingmode).errors— records that couldn't be imported with the reason.
Migration pattern#
Moving a zone from another provider:
- Export from the source using that provider's tool (usually produces a BIND file).
- Create the zone in ScaiDNS (
POST /api/v1/domains/). - Validate it (TXT challenge at the source provider).
- Preview the import to catch errors:
POST /import/previewwithmode: merge. - Apply the import:
POST /import/textor/importwithmode: replace(after the zone's SOA and NS are excluded from the source file, usually automatic). - Delegate NS at the registrar to the ScaiDNS nameservers.
- Wait for TTLs to expire at the old provider.
- If you want DNSSEC, enable it and publish DS records.
What's next#
- Managing Records — direct CRUD for records.
- Bulk Operations — record-level bulk create/delete.
- Templates — reusable record sets vs ad-hoc imports.