DevTools Logo

DNS Zone File Editor

DNS Zone File Editor

Parse a BIND zone into an editable record table, catch mistakes and export valid zone syntax with TXT chunking.

Runs in your browser
Origin example.com.$TTL 3600
Try an example

Zone file

23 lines · 914 chars

BIND syntax only. The file never leaves this tab; clear the draft to remove it from this browser.

Records & validation

13 records · 0 errors · 0 warnings
Origin example.com.$TTL 360013 records0 errors0 warnings
Parsed DNS records
OwnerTTLTypeRdata
—SOAns1.example.com. hostmaster.example.com. 2026010101 7200 3600 1209600 3600
—NSns1.example.com.
—NSns2.example.com.
—A192.0.2.53
—A192.0.2.54
—A192.0.2.10
—A192.0.2.10
—A192.0.2.11
—A192.0.2.25
—MX10 mail.example.com.
—SRV0 5 5060 sip.example.com.
—TXTv=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghij (2 chunks)
—TXTv=spf1 a mx -all

SOA serial helper

Current 2026010101Suggested 2026120301

The date in the serial is in the past: use today's date, revision 01.

Examples

Sticky owner and relative names

Input
$ORIGIN example.com.
$TTL 3600
@ IN A 192.0.2.10
  IN A 192.0.2.11
Output
@ A 192.0.2.10
@ A 192.0.2.11

The indented second line inherits the apex owner; the two A records form a round-robin set.

DKIM TXT chunking

Input
selector._domainkey IN TXT "<more than 255 octets>"
Output
selector._domainkey IN TXT ( "<255 octets>"
    "<remaining octets>" )

Chunking counts UTF-8 octets, not characters, and the chunks concatenate back to the original value.

Serial bump

Input
2026010101 (dated in the past)
Output
2026112701 (today + revision 01)

Date-style serials use YYYYMMDDNN: a past date resets to today at 01; the same date increments NN.

About this tool

The DNS Zone File Editor turns a BIND zone file into an editable record table. It parses directives, parenthesised SOA blocks, quoted TXT strings and blank owners, then re-serialises the result as valid zone syntax. Every step runs in your browser tab: no DNS queries, no uploads, no account.

Validation covers the mistakes that make zone edits fail after propagation: exact duplicate records, CNAME coexisting with other data at the same owner, MX/NS/SRV targets that point at aliases, malformed IPv4 and IPv6 addresses, SOA serial and timer problems, TTL anomalies, relative names with no $ORIGIN, and missing apex NS records. Findings name the affected row so you can jump straight to it.

Export is canonical and deliberately conservative. SOA and NS records come first, the rest are sorted by name and type, names are written relative to $ORIGIN where possible, and explicit TTLs appear only when they differ from $TTL. Long TXT values are split into quoted character-strings of at most 255 octets — the unit that RFC 1035 actually limits — so DKIM and SPF records survive the round trip. Comments remain attached to their records instead of disappearing.

What this tool does not do

  • BIND master-file syntax only; tinydns and Windows DNS exports are not native formats, though BOM and CRLF are handled.
  • No live DNS resolution is performed and the tool does not check whether referenced hosts actually exist.
  • $GENERATE templates are reported but not expanded, and $INCLUDE files cannot be resolved offline.
  • DNSKEY, RRSIG, DS and NSEC records are displayed and preserved verbatim, but signatures and signing order are not validated.
  • Non-ASCII owner names are flagged; the tool does not convert them to punycode A-labels for you.
  • Comments are preserved by attaching them to the following record, so comments that sat between records may move with that record after sorting.

How to use this tool

  1. Paste or load a zone

    Paste a BIND zone file into the left pane, load a local .zone file, or choose one of the examples.

  2. Review the record table

    Use the type chips and search box to find a row. Click a row to open its type-specific fields.

  3. Fix findings

    Read the validation report, click a finding to highlight its row, and edit or remove records as needed.

  4. Check the SOA serial

    Use the serial helper to apply an RFC 1912-style YYYYMMDDNN bump before you ship the zone.

  5. Export

    Copy or download the canonical zone text and run named-checkzone against it before publishing.

Use cases

Edit a self-hosted BIND zone

Add a mail A record and an MX, check the SOA serial, and export a file named-checkzone will accept.

Review infrastructure-as-code diffs

Paste a generated zone, inspect the record table for conflicts and normalise it before committing.

Migrate a client zone

Bring a Windows-exported zone with BOM and CRLF line endings into a clean BIND-style canonical file.

Debug a DKIM record

See a long TXT as one editable string while the export splits it into legal 255-octet chunks.

Zone syntax handled by the editor

Input formWhat the editor does
$ORIGIN example.com.Sets the origin used to expand @ and relative names; emitted as a header.
$TTL 3600 or 1hDefault TTL for records without an explicit TTL; unit suffixes are normalised to seconds.
name [ttl] [class] type rdataTTL and class may appear in either order; IN is the default class.
IN A 192.0.2.1Leading whitespace keeps the previous owner (sticky owner rule).
@ IN SOA ns hostmaster ( … )Multi-line parenthesised rdata is parsed and re-emitted with labelled timers.
TXT "a" "b"Quoted strings are joined for editing, then re-chunked by 255 octets on export.
\" \\ \; \DDDEscapes are decoded for editing and re-escaped losslessly, including decimal octet escapes.
$GENERATE / $INCLUDEReported as unsupported: templates are not expanded and includes are not resolved.

Input is BIND master-file syntax. dig/AXFR output can be pasted as a starting point, but it is not itself a zone file.

Common mistakes

Mistake:Forgetting the trailing dot on a target name.

Fix:A name without a dot is relative to $ORIGIN, so mail becomes mail.example.com. Write mail.example.com. when you mean an FQDN.

Mistake:Lowering the SOA serial after an edit.

Fix:Secondary servers compare serials and ignore a zone whose serial went backwards. Apply the suggested YYYYMMDDNN bump.

Mistake:Putting an A or MX record next to a CNAME at the same name.

Fix:RFC 1034 forbids it; move the address record to another owner or drop the CNAME.

Mistake:Assuming 255 TXT characters is the same as 255 TXT octets.

Fix:UTF-8 characters can take up to four bytes. This tool chunks by octets and preserves \DDD escapes.

Mistake:Trusting a zone that has no apex NS record.

Fix:named-checkzone expects at least one NS at the zone apex; the validation report calls out the omission.

Frequently asked questions

What are $ORIGIN and @ in a zone file?

$ORIGIN sets the domain that unqualified names are appended to. @ means the zone apex — the value of $ORIGIN. So with $ORIGIN example.com., a record named www becomes www.example.com., while @ becomes example.com. A name that already ends in a dot is absolute and is not changed.

Why must TXT strings be split at 255?

RFC 1035 limits each character-string in a TXT record to 255 octets, not 255 JavaScript characters. A DKIM key longer than that must be stored as several quoted strings inside the same record; resolvers concatenate them. This editor splits on octet boundaries, so UTF-8 text and \DDD escapes stay intact.

What makes a CNAME invalid with other records?

RFC 1034 says a name that has a CNAME cannot have any other record: no A, AAAA, MX or TXT at the same owner. Otherwise resolvers cannot decide which answer to return. The editor flags both the CNAME and the conflicting rows. DNSSEC records such as RRSIG are a documented nuance and are outside this check.

How should I bump my SOA serial?

Use the YYYYMMDDNN form from RFC 1912: the date followed by a two-digit revision. If the current serial has today's date, increment the revision (…04 becomes …05). If it is older, use today's date with revision 01. Future-dated serials keep increasing. Never lower a serial — secondary servers will ignore the zone.

Are my zone changes published anywhere?

No. Parsing, validation and export all happen in this browser tab. There is no DNS query, no server request and no upload. A draft is kept in this browser's local storage so you can come back to it; use Clear to delete it.

Does the editor preserve comments?

Yes. Comments are attached to the record that follows them and are written back out during export. Because records are sorted canonically, a comment may end up next to a different neighbour than in the original file, but its record stays with it.

Can I paste dig or AXFR output?

You can paste it as a starting point: lines with the same shape as resource records are parsed. dig output often includes headers, TTL columns and comments that are not zone syntax, so review the validation report before exporting. The tool does not query nameservers itself.

Why does a relative name without $ORIGIN fail?

BIND cannot tell whether www means www.example.com. or a name outside the zone. Add $ORIGIN example.com., or write fully qualified names with a trailing dot. The editor reports every affected line.

Does this replace named-checkzone?

No. It catches common authoring mistakes and emits conservative syntax, but named-checkzone is the authoritative check against your BIND version and configuration. Run it on the exported file before publishing.

References & standards