What are the common DNS record types: A, AAAA, CNAME, MX, TXT and NS?
A maps a name to an IPv4 address, AAAA to an IPv6 address, CNAME makes one name an alias of another, MX names the mail servers, TXT holds free text such as verification and SPF data, and NS lists the authoritative name servers for the domain.
Explain it simply
DNS is the phone book of the internet. Each record type is a different kind of entry: someone's home number (A), their mobile (AAAA), a nickname pointing to another entry (CNAME), and who handles their post (MX).
Example
example.com. A 203.0.113.10
example.com. AAAA 2001:db8::10
www.example.com. CNAME example.com.
example.com. MX 10 mail1.example.com.
example.com. MX 20 mail2.example.com.
example.com. TXT "v=spf1 include:_spf.example.net ~all"
example.com. NS ns1.example.net.MX has a priority number, and a lower number is tried first. TXT is used to prove domain ownership to services like Google and to publish email-sender rules (SPF, DKIM, DMARC). PTR records do the reverse job: IP address to name.
You check them with dig example.com MX or nslookup -type=MX example.com.
What to say in the interview
"A and AAAA give addresses, CNAME is an alias, MX routes email with priorities, NS delegates the zone, TXT holds text like SPF. Records are served by the domain's authoritative name servers."
Common mistakes
- Pointing an MX record at a CNAME or an IP address. MX must point to a hostname with an A or AAAA record.