DNS Record Formatter
Record
example.com A 192.168.1.1
How it works
DNS records are the building blocks of the internet's naming system, mapping domain names to IP addresses, mail servers, verification tokens, and service endpoints. Formatting DNS records correctly is critical because zone file syntax is strict — a misplaced period, incorrect TTL, or wrong record class will cause DNS resolution failures.
**Common record types** A: maps hostname to IPv4 address (example.com. 300 IN A 93.184.216.34). AAAA: maps hostname to IPv6 address. CNAME: canonical name alias — points one hostname to another (www → example.com — cannot coexist with other records at same name). MX: mail exchanger with priority (10 mail.example.com. — lower number = higher priority). TXT: arbitrary text — used for SPF ("v=spf1 include:_spf.google.com ~all"), DKIM public keys, domain ownership verification. NS: authoritative nameservers for the zone. SOA: Start of Authority — zone metadata (primary NS, admin email, serial number, refresh intervals). SRV: service locator (_http._tcp.example.com. 3600 IN SRV 10 20 80 server.example.com.).
**TTL guidance** TTL (Time to Live) is in seconds: 300=5min, 3600=1hr, 86400=24hr. Lower TTL before planned DNS changes (reduces propagation delay). Raise TTL after changes stabilize (reduces resolver query load). Minimum practical TTL: 60s for highly dynamic endpoints; 3600s for stable records.
**Zone file format notes** The trailing dot on FQDNs in zone files is mandatory (example.com. vs example.com). @ represents the zone apex. $ORIGIN sets the default domain suffix for relative names. $TTL sets the default TTL for all following records.
Frequently Asked Questions
- The DNS specification (RFC 1034) prohibits CNAME records at a zone apex (root domain like example.com, as opposed to www.example.com) because the apex must have SOA and NS records, and a CNAME cannot coexist with other record types. This is the 'CNAME at apex' problem. Services like Cloudflare (CNAME Flattening), AWS Route 53 (ALIAS record), and Netlify (custom ALIAS behavior) solve this with proprietary extensions that behave like CNAME at the API level but synthesize A records at the DNS level, complying with the specification.
- SPF (Sender Policy Framework) is a DNS TXT record that lists authorized mail sending sources for a domain, reducing email spoofing. Format: v=spf1 [mechanisms] [qualifier]. include:_spf.google.com (authorize Google Workspace). ip4:203.0.113.0/24 (authorize IP range). ~all (softfail — deliver but mark suspicious). -all (hardfail — reject). Example: v=spf1 include:_spf.google.com include:mailgun.org ip4:203.0.113.10 ~all. Limit: max 10 DNS lookups in SPF evaluation (each include counts). Exceeding 10 lookups causes SPF permerror.
- DNS propagation is the time for a DNS record change to be visible globally. When you update a record, the change is immediate at your authoritative nameserver. However, recursive resolvers worldwide have cached the old value with its TTL. Caches expire after the TTL — a record with TTL=3600 takes up to 1 hour to expire from all caches worldwide. To minimize propagation time: lower the TTL to 300 (5 minutes) 24–48 hours before a planned change, make the change, wait 5–10 minutes, then restore a higher TTL. Some resolvers may cache beyond the TTL; full global propagation can take up to 48 hours in pathological cases.
- A records map a hostname to an IPv4 address (32-bit, dotted decimal: 93.184.216.34). AAAA records map a hostname to an IPv6 address (128-bit, colon-hex: 2606:2800:220:1:248:1893:25c8:1946). Both record types can exist for the same hostname (dual-stack). Modern resolvers prefer AAAA when available if the client has IPv6 connectivity. For maximum compatibility, publish both A and AAAA records. Many cloud services (AWS, Azure, GCP load balancers) still primarily use IPv4 — check your infrastructure before publishing AAAA records.