# Import and export a zone file

> Download your whole zone as a BIND file, or load one in with a preview first. An import never deletes anything.

Source: https://veldhost.eu/docs/dns-zone-files

Last verified: 2026-11-13

A zone file is your domain's records in one text file. It uses the standard BIND format that most DNS hosts read and write. Export one to keep a copy before a big change, or to take your DNS elsewhere. Import one to bring many records in at once, for example from your old DNS provider.

[DNS records, explained simply](https://veldhost.eu/docs/dns-records-explained) has the short version. This page covers every step and what the preview tells you.

## Before you start

- Importing takes the **Owner**, **Administrator** or **Developer** role. Anyone on the account can export.
- The domain's DNS must be hosted here. Moving it from another provider? [Move your DNS to veldhost](https://veldhost.eu/docs/move-your-dns-to-veldhost) copies your live records for you, so you may not need a file at all.

## Export a zone

Open [Domains](https://manage.veldhost.eu/portal/domains) → your domain → **DNS records**, then choose **Download zone file**. You get `YOUR_DOMAIN.zone`, with every record exactly as our nameservers serve it.

After a few comment lines, the file sets `$ORIGIN` and `$TTL`. The SOA and the domain's own NS records are included only as comments under "managed by veldhost": they are there for reference and are ignored if you import the file again. Long TXT values, such as DKIM keys, are split into quoted 255-byte strings, as other DNS servers expect. If you export a zone and import that file straight back, nothing changes.

## Import a zone file

1. On the same page, choose **Import zone file**. The **Import a zone file** box opens below the records.
2. Paste the file into the box, or choose a file to upload. A zone file can be up to 256 KB.
3. Choose **Preview import**. Nothing is written yet.
4. Read the preview (see below). If a line is refused, you can fix the file and preview again, or go ahead without that line.
5. Choose **Apply import**.

> **Caution:** **Apply import** overwrites records that have the same name and type, with the file's value or TTL. They are listed under **Will be updated**, with the current value next to the new one. Check that list before you apply.

You return to the records page and see how many records were added, how many were updated and how many were already in place. The whole import is one entry in [History](https://veldhost.eu/docs/dns-change-history), so a single **Undo** reverses it.

If someone changes the zone while you are looking at the preview, **Apply import** does not go ahead. You see the updated plan instead, and you can check it and apply again.

## Reading the preview

The counts at the top match the sections below them:

- **Will be added**: records that are not in the zone yet.
- **Will be updated**: an existing record of the same name and type takes the file's value or TTL.
- **Already in place**: identical records. The file and the zone agree.
- **Skipped**: lines we deliberately leave alone. These are the SOA, your domain's own NS records (we manage those), and lines that repeat an earlier line.
- **Refused**: lines that will not be imported, each with its line number and the reason.

Every line goes through the same checks as the [record editor](https://veldhost.eu/docs/dns-record-editor), so an import can never add a record the editor would refuse. Common reasons for a refused line:

- The record type is not one you can manage here. An import accepts the editor's types (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA and PTR), with NS only for names below your domain. DNSSEC records (RRSIG, DNSKEY, NSEC and the like) are refused because we create them when we sign the zone.
- The name or `$ORIGIN` is outside this domain.
- A `$INCLUDE` or `$GENERATE` line. Only `$ORIGIN` and `$TTL` are read.
- The value fails a check, for example an IP address in a CNAME.

An import only adds and updates. A record that is in your zone but not in the file stays as it is. To remove records, delete them in the editor.

If the zone is signed with [DNSSEC](https://veldhost.eu/docs/dnssec), it is re-signed automatically after the import.

## With the API or an AI assistant

- `GET /api/v1/dns/{zone}/export` returns the same file as the button. It needs only the `read` scope.
- `POST /api/v1/dns/{zone}/import` with `{"zone_file": "..."}` returns the plan as JSON (`adds`, `updates`, `unchanged`, `rejected`, `skipped`) and writes nothing. Send `"dry_run": false` to apply it. Both the preview and applying need the `dns` scope and the **Owner**, **Administrator** or **Developer** role.

The MCP tools `export_dns_zone` and `import_dns_zone` work the same way. `import_dns_zone` previews unless it is called with `dry_run=false`, so an assistant can show you the plan before anything changes. An applied import is one entry in History, marked **zone import via the API**, and one **Undo** reverses it.

## Related

- [Edit DNS records](https://veldhost.eu/docs/dns-record-editor)
- [Undo a DNS change](https://veldhost.eu/docs/dns-change-history)
- [Move your DNS to veldhost](https://veldhost.eu/docs/move-your-dns-to-veldhost)
- [All API endpoints](https://veldhost.eu/docs/api-endpoints)