Overview
Introduction
Hand-writing a BIND zone file means getting the SOA record's parenthesized field order right, remembering to trail fully-qualified names with a dot, and correctly formatting the admin email's dot-for-@ substitution, all easy details to get subtly wrong.
This tool builds the file from clearly labeled fields instead, entirely in your browser.
What Is DNS Zone File Generator?
A BIND-style DNS zone file generator that produces the $ORIGIN/$TTL header, a fully formatted SOA record, and one line per resource record you add.
It's part of this site's DNS & Domain Tools collection and supports the six most common record types: A, AAAA, CNAME, MX, TXT, and NS.
How DNS Zone File Generator Works
The zone origin and TTL become the file's $ORIGIN and $TTL directives; the primary nameserver, admin email, and five numeric SOA fields (serial, refresh, retry, expire, minimum) are assembled into the standard parenthesized SOA record format that BIND expects.
Each resource record row is validated for its type (MX rows require a numeric priority) and rendered as a tab-separated name/class/type/value line, in the order you added them.
When To Use DNS Zone File Generator
Use it when standing up a new authoritative zone for a domain and you want a correctly structured starting zone file rather than hand-assembling one from a template.
It's also useful for double-checking the SOA field order and admin-email escaping rules when reviewing an existing zone file someone else wrote.
Features
Advantages
- Produces the SOA record's fields in the correct order with the admin email correctly converted from @ to dot notation automatically.
- Supports the six record types that cover the overwhelming majority of real zone files in one form.
- Requires all SOA numeric fields to be entered explicitly, avoiding an accidentally-omitted field that would otherwise break the record.
Limitations
- Doesn't support less common record types like SRV, CAA, or DNSSEC-related records (DNSKEY, DS, RRSIG); only A/AAAA/CNAME/MX/TXT/NS are covered.
- Doesn't validate that record values are semantically correct (e.g. that an A record's value is actually a valid IPv4 address) beyond requiring the field isn't empty.
- Doesn't track or auto-increment the serial number between edits; you supply and manage it yourself.
Examples
Best Practices & Notes
Best Practices
- Increment the serial number on every edit, using a consistent convention like YYYYMMDDnn, so secondary nameservers reliably detect and pull the update.
- Set expire meaningfully longer than refresh and retry combined, so a secondary doesn't stop serving the zone during a brief primary outage.
- Terminate any manually-added fully-qualified name with a trailing dot; a name without one is interpreted as relative to $ORIGIN, which is a common source of subtly broken zone files.
Developer Notes
The admin email's local part has any literal dot escaped with a backslash before the @ is replaced with a dot, matching RFC 1035's master file syntax for the SOA RNAME field, since an unescaped dot in that position would otherwise be parsed as an additional label boundary rather than part of the local part.
DNS Zone File Generator Use Cases
- Generating a starting zone file when provisioning a new authoritative DNS zone
- Producing a consistent SOA record and record set for a documentation example or internal runbook
- Reviewing the correct SOA field order and email-escaping convention against a real, generated example
Common Mistakes
- Forgetting to increment the serial number after editing a zone, so secondary nameservers never notice the change and continue serving stale data.
- Leaving off the trailing dot on a fully-qualified nameserver or mail server hostname, causing it to be silently interpreted relative to the zone origin instead.
Tips
- Use the MX Record Lookup tool afterward to confirm a live zone's MX records actually match what you intended to publish.