DNS Zone File Checker

Check a BIND zone file for the mistakes that stop it loading or break a domain
Paste a BIND zone file to find the mistakes that stop it loading or quietly break a domain: a missing trailing dot, a CNAME next to other records, MX or NS records that point to an IP address or a CNAME, a missing SOA or NS record, TTLs that disagree, a serial that wasn’t raised, and SPF, DMARC and CAA records written wrong. Then copy the commands to check, load and confirm it on the server.
RUNS ENTIRELY IN YOUR BROWSER · NOTHING IS SENT ANYWHERE

Records you’ll use most

TypeExampleWhat it’s for
SOA@ IN SOA ns1.example.com. hostmaster.example.com. ( 2026111701 7200 3600 1209600 300 )One per zone, at the top. The main name server, the admin mailbox (its @ written as a dot), the serial, and the timers the other name servers follow.
NS@ IN NS ns1.example.com.The zone’s name servers. Use at least two, ideally on different networks.
Awww IN A 192.0.2.10An IPv4 address.
AAAAwww IN AAAA 2001:db8::10An IPv6 address.
CNAMEblog IN CNAME example.github.io.“This name is really that name.” Nothing else can share the name, so the zone’s own name (@) can’t be a CNAME.
MX@ IN MX 10 mail.example.com.Mail servers, lowest number tried first. Must name a host with its own A or AAAA record, never an IP address or a CNAME.
TXT@ IN TXT "v=spf1 mx -all"SPF, DMARC, DKIM keys and site verification. Each quoted part holds at most 255 characters; write longer values as several quoted parts.
SRV_sip._tcp IN SRV 10 60 5060 sip.example.com.Priority, weight, port and host for services like SIP, XMPP, LDAP and Active Directory.
CAA@ IN CAA 0 issue "letsencrypt.org"Which certificate authorities may issue certificates for the domain.
PTR10 IN PTR www.example.com.Reverse lookups, in zones like 2.0.192.in-addr.arpa.

Zone file rules worth knowing

Changing a live zone safely

  1. A day ahead, lower the TTL of the records you’ll change (to 300, say), so the old answers run out quickly once you switch.
  2. Copy the file first: sudo cp /etc/bind/db.example.com /etc/bind/db.example.com.bak
  3. Make the change and raise the serial.
  4. Check it: sudo named-checkzone example.com /etc/bind/db.example.com. It prints OK and the new serial.
  5. Load it: sudo rndc reload example.com. If it doesn’t load, sudo journalctl -u named -n 50 says why. (Older Debian and Ubuntu call the service bind9.)
  6. Look it up: dig @localhost www.example.com +short, then dig +nssearch example.com to see that every name server gives out the new serial.
  7. Once it’s working, put the TTL back.

Catch zone file mistakes before you reload BIND

Paste a zone file and every problem is listed by line: the errors that make BIND refuse to load the zone, and the mistakes it accepts that still break lookups, such as a missing trailing dot that turns mail.example.com into mail.example.com.example.com. The checker was tested against BIND’s own named-checkzone. You also get the next serial number and the commands to check, load and confirm the zone on the server.

Common questions

How do I check a BIND zone file for errors?

On the server, run sudo named-checkzone example.com /etc/bind/db.example.com. It prints OK and the serial, or the line BIND rejects. This page finds the same errors and adds the mistakes BIND accepts but that break lookups, such as a missing trailing dot or an MX record that points to a CNAME.

What does “CNAME and other data” mean?

A name with a CNAME record can’t have any other record, and BIND refuses to load a zone that breaks this rule. Keep either the CNAME or the other records. The zone’s own name always has SOA and NS records, so it can never be a CNAME: give it A and AAAA records instead.

Why does a name in a zone file need a trailing dot?

A name without one is relative, so the zone name is added to it. In example.com, mail.example.com becomes mail.example.com.example.com., which doesn’t exist. Write the full name with a dot at the end, mail.example.com., or just mail.

What format should the SOA serial be?

Any whole number up to 4294967295 that goes up every time the zone changes. Most people use the date plus two digits, like 2026111701. If the serial doesn’t go up, the other name servers keep the old copy. To push a zone to a secondary whatever its serial, run sudo rndc retransfer example.com on that secondary.

Can an MX record point to a CNAME or an IP address?

No. An MX record must name a host that has its own A or AAAA record. An IP address there is read as a host name and doesn’t work; a CNAME breaks the rules for mail (RFC 2181), and some mail servers won’t deliver to it. The same goes for NS and SRV records.

Related tools: DNS Propagation Checker · Email DNS Generator (SPF, DKIM, DMARC) · All tools A–Z