Skip to content

Import a zone into STACKIT DNS

The zone import feature allows you to import DNS zone files or lists of records into the DNS management system. This is useful when you:

  • want to migrate your DNS records from another provider
  • have a large number of records to add
  • want to save a current zone and use point in time recovery
  • want to bulk update records
  • want to bulk delete records
  • You have a STACKIT DNS zone: Manage DNS Zones
  • You have a valid DNS Zone file (content of the desired DNS Zone or list of records in CSV, JSON or BIND format).

Restore sets the whole zone to the input (except for the SOA Record). Every single record that is not present in the input will be deleted. Only records and record sets from the input remain or will be created.

Update will update record sets in a constructive way. Records present in the input will be created if a fitting Record Set exists. Existing records and record sets that are not mentioned in the input will not be deleted. Also TTL and the comment in the RRSet can be updated.

Delete will delete all records from the input that match records within the zone in Type, Content and Name. No new Records will be created and unmatched records will be ignored.

Upsert will update and create records and record sets in a constructive way. Records will be created in a fitting Record Set. Non-fitting Records will be turned into new Record Sets. Nothing will be deleted but TTL and the comment can be changed.

All of the viable import formats are compatible with the respective export format.

The CSV format needs 5 fields, but the comment can be empty and similar to the BIND format all records are individual. The header row is optional.

name,ttl,type,content,comment
examplezone.test.,3600,SOA,"ns1.stackit.cloud. hostmaster.stackit.cloud. 2024040500 3600 600 1209600 60",
examplezone.test.,3600,NS,"ns1.stackit.cloud.",
examplezone.test.,3600,NS,"ns2.stackit.zone.",
a.examplezone.test.,500,A,"1.2.3.4",comment
b,3600,A,"2.3.4.5",

In the JSON format records need to be grouped together to their respective record set.

{
"rrSets": [
{
"name": "examplezone.test.",
"type": "SOA",
"ttl": 3600,
"comment": "",
"content": [
"ns1.stackit.cloud. hostmaster.stackit.cloud. 2024040500 3600 600 1209600 60"
]
},
{
"name": "examplezone.test.",
"type": "NS",
"ttl": 3600,
"comment": "",
"content": [
"ns1.stackit.cloud.",
"ns2.stackit.zone."
]
},
{
"name": "b.",
"type": "A",
"ttl": 3600,
"comment": "",
"content": [
"2.3.4.5"
]
},
{
"name": "a.examplezone.test.",
"type": "A",
"ttl": 500,
"comment": "comment",
"content": [
"1.2.3.4"
]
}
]
}

The BIND format needs a row for each record which then get grouped into record sets. The comment is optional.

examplezone.test. 3600 SOA ns1.stackit.cloud. hostmaster.stackit.cloud. 2024040500 3600 600 1209600 60
examplezone.test. 3600 NS ns1.stackit.cloud.
examplezone.test. 3600 NS ns2.stackit.zone.
b 3600 A 2.3.4.5
a.examplezone.test. 500 A 1.2.3.4 ; comment

There are two ways to import a zone into STACKIT DNS. Both using the API (via Postman in the example) or via Portal will result in the same outcome.

The Portal allows to either import a zone using raw input in a small web editor or uploading a zone file. Both possibilities allow all import types as well as all zone formats and are fully compatible with the zone export.

Using the import records raw input feature, you can paste multiple records or the content of a zone file.

  1. Open your project in the STACKIT Portal.
  2. Navigate to Networking > DNS.
  3. Click Create resource record and in the dropdown on Import records raw input.
  4. On the pane select the Format, the Import type and insert the actual zone data.
  5. Click on Import to finish.

The Import records file feature is especially useful for migrating or restore a prior backed up zone. It allows you to upload a complete zone file.

  1. Open your project in the STACKIT Portal.
  2. Navigate to Networking > DNS.
  3. Click Create resource record and in the dropdown on Import records file.
  4. On the pane select the Format, the Import type and select a file on your local computer.
  5. Click on Next.
  6. Check if everything is correct and then click on Import to finish.