How to generate a DNS zone file
Define the domain name
Enter the main domain name (e.g., example.com) and the server IP address for the A record.
Configure additional records
Add CNAME records for subdomains (www, mail, blog), MX records for email, and TXT records for verification and SPF.
Set the TTL
Define the TTL (Time To Live) in seconds. Common values: 300 (5 min) for development, 3600 (1 hour) for production, 86400 (24h) for stable records.
Generate and download
Generate the zone file in BIND format. Download the file or copy the content to install on your DNS server.
Install on the DNS server
Copy the file to /etc/bind/zones/, configure named.conf.local and reload BIND9 with sudo systemctl reload bind9.
BIND9 Configuration
After generating your DNS zone, configure it in BIND9:
1. Create zones directory
sudo mkdir -p /etc/bind/zones
2. Copy zone file
sudo cp db.example.com /etc/bind/zones/db.example.com
3. Configure named.conf.local
zone "example.com" {
type master;
file "/etc/bind/zones/db.example.com";
}; 4. Verify and reload
sudo named-checkzone example.com /etc/bind/zones/db.example.com sudo systemctl reload bind9
DNS Record Types Explained
Each DNS record type serves a specific function in name resolution. Here are the most important ones:
- A Record: Points a domain name to an IPv4 address. The most basic and essential record for any website.
- AAAA Record: Similar to A but for IPv6 addresses. Required if your server supports IPv6.
- CNAME Record: Creates an alias from one name to another. E.g., www.example.com → example.com. Cannot coexist with other records on the same name.
- MX Record: Defines mail servers for the domain with priority. Lower number = higher priority.
- TXT Record: Stores arbitrary text. Used for domain verification (SPF, DKIM, DMARC, Google Workspace, etc.).
- NS Record: Specifies authoritative DNS servers for the domain.
- SRV Record: Defines specific services (SIP, LDAP, XMPP) with port and priority.
Our generator automatically creates the SOA record with recommended values and supports all these record types. Simply select the ones you need and the tool will generate the complete BIND9 zone file.