DNS basics2 min read

DNS Record Types Explained: A, AAAA, CNAME, MX, TXT, NS and More

By DNSRadar

DNS zones contain different record types for different jobs. Knowing which one to inspect avoids chasing the wrong problem during a website launch, email migration or certificate renewal.

Website and address records

  • A maps a hostname to an IPv4 address.
  • AAAA maps a hostname to an IPv6 address.
  • CNAME makes one hostname an alias of another hostname.
  • CAA controls which certificate authorities may issue TLS certificates.

Email and verification records

  • MX tells senders where to deliver inbound mail.
  • TXT stores SPF, DKIM, DMARC and domain verification values.
  • SRV publishes service hostnames and ports for protocols such as SIP or LDAP.
  • PTR maps an IP address back to a hostname through reverse DNS.

Authority and delegation records

  • NS lists the authoritative nameservers for a zone.
  • SOA identifies zone authority, serial number and timing values.
  • Parent-zone delegation and child-zone NS data should remain consistent.
  • DNSSEC-related failures often appear as SERVFAIL from validating resolvers.

Quick terminal examples

Common lookupsdig
dig example.com A +short
dig example.com MX +short
dig example.com TXT +short
dig example.com NS +short
dig -x 8.8.8.8 +short

Follow the dependencies of a mail service

Records are not interchangeable settings. In this illustrative zone, example.com's MX selects a receiving hostname, that hostname's A locates its IPv4 server, and the SPF TXT authorizes an outbound sender. Changing the website's A does not change where mail is delivered or authorize the new host to send mail.

Read the chain from the service you are diagnosing. For inbound email, query MX and then the selected targets' A/AAAA. For a website behind an alias, query CNAME and then resolve its target. For service discovery, query the full SRV name and then its destination. PTR is managed in the IP's reverse zone and is independent of all these forward records.

The number 10 in MX is a preference; 300 before IN is a TTL in seconds; neither is a port. SRV has separate priority, weight and port fields. Keep the owner name, type and complete value when comparing exports: searching for one expected IP across every record can hide a wrong owner or an unrelated TXT string.

Illustrative dependency chaindig
example.com.      300 IN MX  10 mail.example.net.
mail.example.net. 300 IN A   192.0.2.20
example.com.      300 IN TXT "v=spf1 ip4:192.0.2.30 -all"

Sources and editorial approach

Technical documentation by DNSRadar. Examples using example.com and documentation addresses are illustrative; adapt commands to your zone and compare authoritative answers before changing production.

How we measure and the tool's limitations · Report a correction

Related DNS guides