DNS Record Types Reference — A, AAAA, MX, CNAME, TXT, NS, PTR and More
This comprehensive DNS record types reference explains every DNS record type, its purpose, format and common use cases. Whether you're migrating a domain, configuring email authentication, setting up DNSSEC or troubleshooting DNS resolution issues, this guide covers everything from the basic A record to advanced security records like CAA, TLSA and DMARC.
How DNS Works
The Domain Name System (DNS) is the internet's phone book — it translates human-readable domain names (example.com) into IP addresses that computers use to communicate. When you type a URL, your device queries a recursive DNS resolver, which walks the DNS hierarchy from root servers → TLD servers (.com, .co.uk) → authoritative name servers for the specific domain — returning the requested record type. The entire process typically completes in under 100ms.
Essential DNS Records for Email Authentication
- SPF (TXT record) — Specifies which mail servers are authorised to send email on behalf of your domain. Prevents email spoofing. Example:
v=spf1 include:_spf.google.com ~all - DKIM (TXT record) — Adds a cryptographic signature to outgoing emails, verifiable by recipients. Prevents tampering. Requires a public key published in DNS.
- DMARC (TXT record) — Instructs receiving mail servers what to do with emails that fail SPF or DKIM checks. Can quarantine or reject spoofed emails. Essential for domain protection.
DNS TTL and Caching
TTL (Time To Live) specifies how long DNS resolvers cache a record before re-querying. A TTL of 3600 means resolvers cache the record for 1 hour. Before making DNS changes (switching hosting, changing MX records), lower the TTL to 300 (5 minutes) 24 hours in advance. This reduces the propagation window — how long old records persist in caches worldwide — ensuring changes take effect quickly and can be easily rolled back if needed.
DNS Troubleshooting Commands
nslookup example.com— Basic DNS lookup (Windows/Linux)dig example.com MX— Query specific record types (Linux/Mac)dig +trace example.com— Trace full DNS resolution chaindig @8.8.8.8 example.com— Query a specific DNS server (Google's 8.8.8.8)nslookup -type=TXT _dmarc.example.com— Check DMARC record