Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

DNS zone and zone file: what is inside

A DNS zone is the part of the domain name space managed as one unit by a set of authoritative nameservers, usually one domain and its subdomains, and its records are stored in a zone file. Every zone begins with an SOA record and lists its NS records.

The short answer
  • A zone can be split: a subdomain can be delegated to different nameservers with its own NS records.
  • The SOA record holds the serial number, refresh timers and the negative caching time.
  • Export the zone file before switching DNS hosts so nothing is lost.
Try the nameserver lookupFree, live, no signup

What does a zone file look like?

Minimal zone file (documentation addresses)
$ORIGIN example.com.
$TTL 3600
@   IN SOA ns1.dnshost.example. hostmaster.example.com. (
        2026112101 ; serial
        7200       ; refresh
        900        ; retry
        1209600    ; expire
        300 )      ; minimum (negative caching)
    IN NS  ns1.dnshost.example.
    IN NS  ns2.dnshost.example.
    IN A   192.0.2.10
    IN MX  10 mail.example.com.
www IN CNAME example.com.

What do the SOA fields mean?

SOA RDATA (RFC 1035, section 3.3.13)
FieldMeaningReal value for example.com (2026-11-21)
MNAMEPrimary nameserver for the zoneelliott.ns.cloudflare.com
RNAMEResponsible mailbox, with the first dot standing for @dns.cloudflare.com
SERIALZone version; secondaries copy when it increases2420077714
REFRESHHow often secondaries check for updates10000 s (2 h 46 min)
RETRYWait before retrying a failed refresh2400 s (40 min)
EXPIREWhen a secondary stops answering if it cannot refresh604800 s (7 days)
MINIMUMUsed for negative caching of missing names1800 s (30 min), shown as "default TTL" by nslookup

Values from nslookup -type=SOA example.com. They change with the provider. Negative caching follows RFC 2308.

How are zones and delegation organized?

Zone versus domain

A domain is a name. A zone is the part of it served from one place. They differ when subdomains are delegated.

Primary and secondary servers

Every zone needs at least two nameservers per RFC 1034; secondaries copy the zone from the primary.

Delegation with NS records

NS records at a cut point hand a subdomain to other nameservers, which then own that subtree.

What do you do with a zone when changing DNS host?

  • Export or copy every record before switching nameservers
  • Check for records an export can miss: TXT verification entries, SRV and CAA
  • Import into the new host and compare record by record
  • Switch nameservers only after the new zone answers correctly
  • Keep the old zone for a few days in case caches still query it

Which records usually sit in a small zone?

Web

A and AAAA records for the apex, and a CNAME or A record for www.

Mail

MX records, plus TXT records for SPF, DKIM and DMARC.

Services

CNAME and TXT records for verification and third-party services, and CAA for certificates.

Common questions

What is a DNS zone?

A DNS zone is an administrative portion of the DNS namespace served by authoritative nameservers. It holds the records for a domain and any subdomains that are not delegated elsewhere.

What is a DNS zone file?

A zone file is a text file that lists a zone resource records in standard master-file format: the SOA record first, then NS, A, MX, CNAME, TXT and the rest. DNS hosts store this data in a database and often let you import or export it.

What is the difference between a DNS zone and a domain?

A domain is a name and everything beneath it. A zone is the slice of that tree one set of nameservers is responsible for. If you delegate sub.example.com elsewhere, it becomes a separate zone.

What does the SOA serial number do?

The serial is the version of the zone. Secondary nameservers compare it with their copy and fetch the zone again when the primary has a higher number. Many hosts increment it automatically on every edit.

How many nameservers does a zone need?

RFC 1034 requires every zone to be served by at least two nameservers, so one failure does not take the domain offline. Most DNS hosts give you two to four, ideally in separate networks.

Can I edit a zone file directly?

Only if your DNS host exposes it. Many hosts offer a record editor plus an import or export of the zone file in standard format. Check what the import keeps, since some tools skip unusual records or reset TTLs.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.