A practical guide to common DNS record types including A, AAAA, CNAME, MX, TXT, NS, SOA, PTR and CAA records.
- Pick the correct record for the job
- Avoid common DNS mistakes
- Understand website, email and security records
A and AAAA records
A records point a hostname to an IPv4 address. AAAA records point a hostname to an IPv6 address. For most website hosting checks, these are the records people inspect first because they decide where the browser connects.
CNAME records
A CNAME record makes one hostname an alias of another hostname. It is useful for subdomains such as www, shop or docs. A common mistake is trying to use a CNAME at the root of a domain where other required records also exist. Always check the rules used by your DNS provider.
MX and TXT records
MX records tell the world which mail servers accept email for a domain. TXT records are flexible text records often used for SPF, DKIM, DMARC, site verification and other services. When email fails, MX and TXT records are usually the first place to look.
NS, SOA, PTR and CAA records
NS records show the authoritative nameservers for a zone. SOA records contain zone metadata such as serial and timing values. PTR records are used for reverse DNS lookups. CAA records can restrict which certificate authorities may issue certificates for a domain.
Quick commands to try
dig example.com Adig example.com MX +shorthost -t TXT example.comPractise the command line side
DNSNow gives you quick web checks. For hands-on Linux command practice, use CommandLineQuiz dig Command Builder, the Linux Troubleshooting Hub and the Bash Scripting Hub.
FAQs
What is the most important DNS record for a website?
Usually the A record for IPv4 and the AAAA record for IPv6, because these point the hostname to the server address.
What DNS records are used for email?
MX records route mail. TXT records are commonly used for SPF, DKIM and DMARC email authentication.
Can I delete old DNS records?
Only after confirming they are not used by websites, email, verification services, subdomains or third-party platforms.