LightAtom

DNS Record Types Explained (A, AAAA, CNAME, MX, TXT, PTR)

A domain's DNS zone holds several kinds of records: addresses, aliases, mail servers, text and more. Here's what each type does.

DNS records are entries in a domain's zone that answer different questions. A and AAAA records give IP addresses, CNAME creates an alias, MX names mail servers, TXT holds text such as SPF and verification tokens, NS lists name servers, and PTR maps addresses back to names.

How it works

The example.com zone with A/AAAA, CNAME, MX, TXT, NS and SOA records around it.

A DNS zone is the set of records a domain's authoritative name servers publish. Each record has a name, a type, a TTL (how long it may be cached) and a value.

The main types

  • A: an IPv4 address. example.com. 300 IN A 203.0.113.10
  • AAAA: an IPv6 address.
  • CNAME: an alias pointing to another name, which is then resolved. Can't coexist with other records on the same name, and can't be used at the zone apex.
  • MX: mail servers for the domain, each with a priority (lower is preferred).
  • TXT: free text. Used for SPF (v=spf1 …), DKIM keys, DMARC policies and domain-ownership tokens.
  • NS: the authoritative name servers for the zone, delegated from the parent (.com).
  • SOA: start of authority: primary server, admin contact, serial number and timers.
  • PTR: reverse DNS, mapping an IP address to a name, under in-addr.arpa or ip6.arpa.
  • CAA: which certificate authorities may issue certificates for the domain.
  • SRV: host and port for a service, used by some protocols (SIP, XMPP, Microsoft 365 autodiscover).

Side by side

TypeMapsExample value
AName → IPv417.253.144.10
AAAAName → IPv62620:149:af0::10
CNAMEName → namewww-apple-com.v.aaplimg.com
MXDomain → mail servers10 mx1.example.com
TXTName → textv=spf1 include:_spf.google.com ~all
NSZone → name serversa.ns.apple.com
PTRIP → namedns.google
CAADomain → allowed CAs0 issue "letsencrypt.org"

Examples

Real lookups from a Mac:

$ dig +short apple.com A
17.253.144.10
$ dig +short www.apple.com CNAME
www-apple-com.v.aaplimg.com.
$ dig +short -x 8.8.8.8
dns.google.

On a Mac

dig name TYPE looks up any record type: dig github.com TXT +short, dig gmail.com MX +short. dig +noall +answer name shows the TTLs. nslookup -type=mx gmail.com works too.

See it in the app

LightAtom follows CNAME chains back to the name an app originally asked for, so its connections view shows www.apple.com, not a CDN host name.

Frequently asked questions

What is an A record?

The DNS record that maps a name to an IPv4 address, like apple.com → 17.253.144.10. AAAA does the same for IPv6.

What is the difference between an A record and a CNAME?

An A record points a name directly to an IP address. A CNAME points a name to another name, whose records are then used.

What is an MX record?

A record naming the mail servers that accept email for a domain, each with a priority. Lower numbers are tried first.

What is a TXT record used for?

Publishing text: SPF, DKIM and DMARC email policies, and verification tokens that prove you control a domain.

What is a PTR record?

A reverse DNS record that maps an IP address back to a host name. It's set by whoever owns the IP block.

LightAtom team

The people who build LightAtom, a network monitor for macOS.