What Is a DNS Zone? How to Read a Zone File Before Moving DNS
Read DNS zone-file owners and targets, then separate records to import from provider settings and delegation changes.
- dns
- zone-file
- nameservers
- guide
A DNS zone is the part of the DNS namespace for which a set of nameservers provides authoritative data. A zone can contain records at its own name and below it. A delegated child can have its own zone. A zone file is a text representation of many of those records and can help move DNS service between providers.
Expand a few records before trusting the import
Consider this excerpt from a fictional zone. The excerpt illustrates how the parser expands names and omits the SOA and NS records required in a complete authoritative zone. RFC 1035 defines the origin and relative names. RFC 2308 defines the default-TTL directive.
| Example line | Result |
|---|---|
$ORIGIN example.test. | Relative names below this directive use example.test. as their origin. |
$TTL 900 | Records without an explicit TTL use 900 seconds by default. |
@ IN A 192.0.2.50 | The zone apex example.test. has an IPv4 address record. |
www 300 IN CNAME @ | www.example.test. aliases to the current origin. This record has its own 300-second TTL. |
@ IN MX 10 mail.provider.example. | The apex points to an external mail host. The trailing dot makes that target absolute. |
Without the last dot on the MX target, a zone-file parser would treat the name as relative and append example.test.. Check both the left-hand owner and any hostname on the right-hand side. A text diff can miss a change of meaning when two files spell the same effective name differently.
Inventory what the destination generates separately
A complete authoritative zone includes an SOA record and apex NS records. Your new DNS host may generate its own SOA and assign its own authoritative nameservers. Follow the host's import instructions and retain intentional NS delegations for any child zone. The DNS architecture in RFC 1034 distinguishes zone content from the delegation that leads to it.
Check provider-specific settings separately. For example, Cloudflare documents import and export tags for proxying and record behavior. Another host may ignore those tags. Move application-specific behavior deliberately, and plan DNSSEC signing and parent DS changes with both providers before changing nameservers.
Compare answers before changing delegation
Import into the destination and query every assigned nameserver directly for each important owner and type. Compare the answers from the old and new authorities for website names, MX, authentication TXT, CAA and delegated subdomains. Record expected differences, such as apex NS and SOA. Then make the nameserver change and verify DNS responses from the new delegation and from a recursive resolver after the cutover.
