Logo

MonoCalc

/

DNS Zone File Generator

Networking

Zone Settings

e.g. example.com (without trailing dot)
≈ 1h

SOA Record

Required
e.g. ns1 or ns1.example.com
Use dot instead of @ (e.g. hostmaster)
YYYYMMDDNN format recommended
1h
15m
7d
Negative caching TTL (RFC 2308)

DNS Records

@ for root domain
A
@ for root domain
MX

Generated Zone File

About This Tool

DNS Zone File Generator – Build BIND-Compatible Zone Files Online

A DNS zone file is the authoritative text file that an authoritative name server reads to answer queries for a domain. Every record for your domain lives in this file: where your web server is (A record), where your mail goes (MX record), what subdomains are aliases (CNAME records), and custom verification or policy text (TXT records). This generator lets you build a complete, standards-compliant zone file interactively — then copy or download the output to deploy on any DNS server that speaks the BIND zone file format, including BIND 9, PowerDNS, NSD, and Knot DNS.

Anatomy of a DNS Zone File

A zone file begins with two directives that set defaults for the entire file, followed by the mandatory SOA record, and then the individual DNS records:

$ORIGIN example.com.
$TTL 3600

@   IN  SOA  ns1.example.com. hostmaster.example.com. (
                2026061201  ; serial
                3600        ; refresh
                900         ; retry
                604800      ; expire
                300 )       ; minimum TTL

@   IN  NS   ns1.example.com.
@   IN  NS   ns2.example.com.
@   IN  A    203.0.113.1
www IN  A    203.0.113.1
@   IN  MX   10 mail.example.com.

The $ORIGIN directive sets the base domain, so bare names like www expand to www.example.com.. The $TTL directive sets the default cache lifetime in seconds for records that do not specify their own TTL. The @ symbol is shorthand for the current origin (i.e., your domain root).

The SOA Record Explained

The SOA (Start of Authority) record is required in every zone and tells the DNS ecosystem who is in charge of the zone. It contains six key values:

FieldTypical ValueMeaning
Primary NSns1.example.com.The authoritative primary name server for the zone
Admin Emailhostmaster.example.com.Administrator email — @ replaced with a dot
Serial2026061201Version counter; must increase on every zone update
Refresh3600How often secondary servers check for updates (seconds)
Retry900How long to wait before retrying a failed refresh (seconds)
Expire604800How long secondaries serve stale data if primary is down
Minimum TTL300Negative caching TTL — how long NXDOMAIN is cached (RFC 2308)

Common DNS Record Types

The generator supports the most widely used record types. Here is a quick reference:

TypePurposeExample Value
AMaps a hostname to an IPv4 address203.0.113.1
AAAAMaps a hostname to an IPv6 address2001:db8::1
MXDesignates mail servers (with priority)10 mail.example.com.
CNAMEAlias from one hostname to anotherexample.com.
TXTArbitrary text — used for SPF, DKIM, verificationv=spf1 ~all
NSDelegates a zone or subdomain to a name serverns1.example.com.

Trailing Dots and FQDNs

One of the most common sources of zone file errors is missing or misplaced trailing dots. A hostname without a trailing dot is relative — the DNS server appends the $ORIGIN to it. A hostname with a trailing dot is an FQDN (Fully Qualified Domain Name) and is treated as absolute. The generator automatically adds trailing dots to absolute hostnames in the CNAME, NS, MX, and SOA target fields, eliminating this class of error.

Serial Number Best Practices

The recommended serial format is YYYYMMDDNN, where NN is a two-digit counter starting at 01 and incrementing each time you publish a new version of the zone on the same day. For example, 2026061201 is the first revision on 12 June 2026. Secondary name servers compare serial numbers to decide whether to fetch a new copy of the zone — the serial must always increase. If you accidentally set a lower serial, secondaries will stop syncing until you advance past the previously seen value.

Setting Up Email with MX and TXT Records

To receive email at your domain you need at least one MX record pointing to your mail server, and optionally a TXT record for the SPF policy that authorizes which servers may send on your behalf. For example, if you use Google Workspace, your records would look like:

@   3600  IN  MX   1   aspmx.l.google.com.
@   3600  IN  MX   5   alt1.aspmx.l.google.com.
@   3600  IN  TXT  "v=spf1 include:_spf.google.com ~all"

Lower MX priority values are tried first. Multiple MX records at different priorities give you both load distribution and failover — clients try the lowest priority server first and fall back to higher values if it is unreachable.

Deploying Your Zone File

After generating your zone file, copy the output into your DNS server configuration: for BIND 9, place it in the directory referenced by your named.conf zone block and run rndc reload. For PowerDNS, import it using pdnsutil load-zone. If you use a cloud DNS provider such as Cloudflare or Route 53, import the file through their zone import feature — both accept standard BIND-format zone files. Always verify the zone with named-checkzone example.com example.com.zone before loading to catch syntax errors.

Frequently Asked Questions

Is the DNS Zone File Generator free?

Yes, DNS Zone File Generator is totally free :)

Can I use the DNS Zone File Generator offline?

Yes, you can install the webapp as PWA.

Is it safe to use DNS Zone File Generator?

Yes, any data related to DNS Zone File Generator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is a DNS zone file?

A DNS zone file is a plain-text file that defines the DNS records for a domain (or zone). It lists every record — A, AAAA, MX, CNAME, TXT, NS, and SOA — in a standardised format that authoritative name servers such as BIND, PowerDNS, and NSD read directly. Every public domain requires at least an SOA record and two NS records to be correctly delegated.

How does this DNS Zone File Generator work?

Enter your domain name and optional default TTL, then fill in the SOA details and add as many DNS records as you need using the record editor. Supported types include A, AAAA, MX, CNAME, TXT, NS, and SOA. Click Generate to produce a standards-compliant zone file you can copy or download and load directly into a DNS server.

What is an SOA record and why is it required?

The SOA (Start of Authority) record must appear exactly once at the top of every zone file. It identifies the primary name server for the zone, the responsible administrator's email address (with @ replaced by a dot), a serial number used to signal zone changes to secondary servers, and four timing parameters: refresh, retry, expire, and minimum TTL for negative caching.

What serial number format should I use?

The most common convention is the date-based format YYYYMMDDNN, where YYYYMMDD is the current date and NN is a two-digit counter starting at 01 that increments each time you update the zone on the same day (e.g., 2026061201). This makes it easy to see when the zone was last updated. The serial number must always increase — if a secondary server sees a lower serial it will not fetch the updated zone.

How do I add an SPF record to the zone file?

SPF records are stored as TXT records. Add a TXT record for your root domain (@) with the value set to your SPF policy, such as v=spf1 include:_spf.google.com ~all. The generator wraps the value in double quotes as required by the zone file format. You can add multiple TXT records for the same name (e.g., one for SPF and one for domain verification).

Why do hostnames in zone files end with a dot?

A trailing dot marks a hostname as a Fully Qualified Domain Name (FQDN), preventing the DNS server from appending the current zone name. For example, ns1.example.com. is absolute, while ns1 (no dot) means ns1.example.com relative to the current zone. The generator automatically appends trailing dots to absolute hostnames so you can paste the output directly into a zone file without manual adjustment.