A DNS zone file is the plain-text source of truth for a domain’s DNS records, written in the RFC 1035 master file format that BIND and most authoritative nameservers understand. When you export a zone from your DNS provider or migrate between hosts, it helps to see every record laid out cleanly with names, TTLs, and types resolved. This parser does exactly that in your browser.
How it works
The parser tokenizes the zone file the way a nameserver would when loading it:
- Lines are pre-processed: semicolon comments are stripped (while respecting quoted strings), and records wrapped in parentheses — such as a multi-line
SOA— are joined into a single logical line. - Directives
$ORIGINand$TTLupdate the current origin and default TTL. - For each record, if the line begins with whitespace the owner name is inherited from the previous record; otherwise the first token is the owner name.
@expands to the origin, and names without a trailing dot get the origin appended. - Optional TTL and class tokens (in either order) are detected, then the record type and remaining tokens become the RDATA.
TTL values such as 1h30m are normalized to seconds using the standard unit table (s, m, h, d, w).
Example
Given the directive $ORIGIN example.com. and the line:
www IN A 203.0.113.10
the parser resolves the owner name to www.example.com., class IN, type A, and RDATA 203.0.113.10. A blank-owner follow-up line inherits www automatically.
Notes
A successful parse confirms the file is syntactically well-formed — it does not query live DNS, so it will not tell you whether the records are actually published or propagated. Use it to audit exports, diff zones, or sanity-check hand-edited records before importing them.