Overview
DNS stores more than just name-to-IP mappings. Different record types answer different questions: where is this name's IPv4 address, its mail server, or an alias it points to. This lesson covers the common DNS record types and what each is for.
Learning objectives
- Identify common DNS record types and their purposes.
- Distinguish A/AAAA, CNAME, MX, TXT, and NS records.
- Read a simple set of DNS records.
Core concept
Common DNS record types include:
- A — maps a name to an IPv4 address.
- AAAA — maps a name to an IPv6 address.
- CNAME — an alias pointing one name to another canonical name.
- MX — specifies the mail server(s) for a domain (with priority values).
- NS — lists the authoritative name servers for the domain.
- TXT — holds arbitrary text, widely used for verification and email-authentication policies (e.g. SPF, DKIM, DMARC).
Each record also has a TTL (time-to-live) controlling how long it may be cached.
How it works
A domain's records live on its authoritative servers. A resolver requests a specific type — asking for the A record of www.example.com returns an IPv4 address; asking for the MX record of example.com returns where its email should be delivered. A CNAME redirects the lookup to another name, which is then resolved to an address. Together these records let one domain describe its web hosts, mail routing, name servers, and policies.
Practical example
For example.com you might find: an A record pointing www to an IPv4 address, an MX record directing mail to mail.example.com, NS records naming the authoritative servers, and a TXT record containing an SPF policy that lists which servers may send mail for the domain. Reading these records tells you how the domain is hosted and how its email is routed and protected.
Cybersecurity relevance
Records are a goldmine for both recon and defense. Enumerating a domain's records (A/AAAA, MX, NS, TXT, subdomains) maps its infrastructure during authorized reconnaissance. TXT-based records (SPF, DKIM, DMARC) are the backbone of email anti-spoofing — misconfigured, they let attackers forge mail from the domain. Analysts inspect records to verify security posture and detect malicious changes.
Common mistakes
- Confusing A and AAAA — A is IPv4, AAAA is IPv6.
- Pointing a CNAME where an A record is required (e.g. some setups disallow CNAME at a zone apex).
- Ignoring TXT-based email records, leaving a domain open to email spoofing.
Key takeaways
- Common records: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail servers), NS (authoritative servers), TXT (text, incl. SPF/DKIM/DMARC).
- Each record has a TTL governing caching.
- Records describe a domain's hosting, mail routing, and security policies — key to both reconnaissance and defense.
Check your understanding
- Which record type would you query to find where a domain's email is delivered?
- What is the difference between an A record and a CNAME record?

