DNS Check can import and export DNS records from zone files. This page covers what zone files are, and how the export and import options work.
What Is a Zone File?
A zone file is a plain text file that describes a DNS zone: the set of DNS records for a domain and its subdomains. Zone files follow a standard format (RFC 1035) that most DNS servers, like BIND, and many DNS hosting providers understand. Here's an example:
$ORIGIN example.com.
@ NS ns1.isp.com.
@ NS ns2.isp.com.
@ A 192.168.0.2
mail A 192.168.0.3
@ MX 10 mail.example.com.
Each line describes one DNS record. The
$ORIGIN
directive sets the domain name that's appended to any record names in the file
that aren't fully qualified (don't end in a dot). In the example above,
mail expands to mail.example.com, while
@ refers to the origin itself (example.com).
Because a zone file is just text, you can move a set of DNS records between systems in one step instead of re-entering each one by hand.
Zone Files vs. Record Groups
DNS Check organizes the records it monitors into DNS record groups rather than zone files. A zone file conventionally holds every record for a single domain. A record group is more flexible: it can cover one domain, several domains, or just a subset of a domain's records. Importing and exporting move records between the standard zone file format and a record group.
Exporting a Zone File
To export a record group's DNS records as a zone file, open the DNS record group and click the Export zone file button. DNS Check renders the group's records as zone file text you can copy.
The export separates records into two sections, because they're often managed in different places:
- Forward DNS records: records of any type other than PTR (for example, A, AAAA, CNAME, MX, and TXT). These are managed on the authoritative name servers for your domain.
- Reverse DNS records: PTR records, which map IP addresses back to names. These are typically managed by your hosting provider or ISP.
Each section has its own Copy button so you can paste the relevant records wherever they belong.
Records that don't fit standard syntax
Some of DNS Check's record types can't be expressed in standard zone file
syntax. Rather than dropping them, DNS Check writes them at the end of the file
as comments (lines beginning with ;). Standard DNS servers ignore
comments, so the exported file is still a valid zone file, and DNS Check can read
the comments back to restore those records on import. The record types handled
this way are:
- Load balancer records, which hold several values and may use CIDR ranges.
- Inverted records, which monitor for the absence of an otherwise standard record.
- Wildcard-value records, which match any value rather than a specific one.
- ALIAS records, which aren't a standard record type with a documented zone file syntax.
Importing a Zone File
To add many DNS records at once, import them from a zone file. Open the DNS record group, click the Import zone file button, and provide your zone file in one of two ways:
- Paste the zone file contents directly into the text area.
- Drag a file onto the drop zone below the text area, or click it to browse for a file. The file is read in your browser, and its contents are placed in the text area, so you can review or edit them before importing. Nothing is uploaded to the server until you click Import.
When you click Import, DNS Check parses the zone file and creates a DNS record for each entry. Standard zone file format (RFC 1035) is supported, along with the non-standard record types DNS Check exports as comments, so a file exported from DNS Check round-trips back into an identical set of records.
Supported records
- Standard record types: A, AAAA, CAA, CNAME, MX, NS, PTR (reverse DNS), SOA, SPF, SRV, and TXT.
- Non-standard records: load balancer, inverted, wildcard-value, and ALIAS records (read from the comment blocks DNS Check writes on export).
- Comments (lines starting with
;). $ORIGINand$TTLdirectives.- Relative and fully-qualified domain names.
Import options
The import form offers a few options:
- Autocorrect syntax errors (on by default): fixes common syntax
problems and attempts to detect the
$ORIGINif it's missing. This handles common quirks in files exported by other providers, such as a missing trailing dot on a domain name. - Make imported records exclusive: when enabled, each imported record is set to exclusive matching, so its check passes only if the full set of DNS records returned for that name and type exactly matches what's monitored.
- Delete existing records: removes all records currently in the group before importing.
$ORIGIN
If your zone file defines an $ORIGIN, DNS Check uses it to expand
relative record names. If no $ORIGIN is defined, the default origin
is . (the DNS root), which means record names are treated as
already fully qualified. With autocorrect enabled, DNS Check also tries to infer
the origin from the file when it isn't stated.
Reverse DNS shorthand
When importing, DNS Check accepts a shorthand for reverse DNS that lets you work with IP addresses directly instead of hand-writing PTR record names:
1.2.3.4 => example.com.creates a PTR record for the address.1.2.3.4 <=> example.com.creates both a forward record (A or AAAA) and a matching PTR record.
Both IPv4 and IPv6 addresses are supported. See the FAQ for more on importing reverse DNS records as IP addresses.
Round-Tripping Records
Because DNS Check preserves its non-standard record types as comments on export and reads them back on import, you can export a record group and import the result into another group (or back into the same one) to reproduce the original records, including load balancer, inverted, wildcard-value, and ALIAS records. Export then import is a straightforward way to clone or back up a record group.
To learn more about adding and monitoring DNS records, see the Monitor DNS Records page.
Additional Resources
- RFC 1035 - section 5 (Master Files) defines the standard zone file format.
- DNS Sample Configurations - a chapter from Pro DNS and BIND with annotated example zone files.
Protect your DNS infrastructure with automated monitoring
Get notified immediately when DNS records change. Start monitoring your critical DNS infrastructure for free in under 5 minutes.
No credit card required • Cancel anytime