December 5, 2026

DNS Record Types Explained With Real Lookups: A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, CAA and HTTPS

An open card catalog drawer standing in for a DNS directory

Ask the global DNS for example.com’s mail server and the answer is a record that says, in effect, “nobody.” Its MX record points to a single dot with a priority of zero, a standard way for a domain to announce that it accepts no email at all. That one answer is a good introduction to what DNS records really are: not just addresses, but short, typed statements a domain makes about itself to the rest of the internet. Every record shown in this post came from a live query to Google Public DNS, so the examples are real, not made up.

Video: PowerCert Animated Videos on YouTube

How the lookups were done

Google’s DNS over HTTPS

Google Public DNS offers a JSON API for DNS over HTTPS. A query names a domain and a record type, and the response lists each matching record with its numeric type, its time to live (TTL) in seconds, and its data. A status of 0 means NOERROR, a normal answer.

Reading the results

Each record below is shown as type, TTL and data. TTL tells resolvers how long they may cache an answer before asking again. The values shown were what Google’s resolver held at query time, so some are counting down from the zone’s original setting. They will differ on any later lookup, which is part of the point: DNS answers are snapshots.

Rows of black server racks with white logos in a data center

Addresses: A and AAAA

A records

RFC 1035, the 1987 specification by Paul Mockapetris, defines type A as “a host address,” an IPv4 address. example.com returned two:

example.com  A  ttl300  172.66.147.243
example.com  A  ttl300  104.20.23.154

AAAA records

AAAA (type 28) is the IPv6 equivalent, and example.com had two of those as well:

example.com  AAAA  ttl300  2606:4700:10::ac42:93f3
example.com  AAAA  ttl300  2606:4700:10::6814:179a

Why two of each

Multiple address records let clients try another server when one fails, and spread visitors across servers. Browsers that support IPv6 typically try AAAA and A answers in parallel and use whichever connects first. A five-minute TTL like these means changes take effect quickly, at the cost of more lookups.

Aliases: CNAME

One name pointing to another

RFC 1035 calls a CNAME “the canonical name for an alias.” Looking up www.wikipedia.org returned:

www.wikipedia.org  CNAME  ttl20503  dyna.wikimedia.org.

A resolver that gets this answer starts over with dyna.wikimedia.org and looks up its addresses. The visitor never sees the second name; the browser still shows www.wikipedia.org.

What a CNAME is not

A CNAME isn’t a web redirect. It changes which server answers, not which address appears in the browser, and it applies to every kind of lookup for that name, mail included. That’s why the DNS rules forbid putting a CNAME at a domain’s root alongside the NS and SOA records that must live there. Hosting providers that offer “CNAME flattening” or “ALIAS” records are working around exactly that restriction.

The long TTL

The 20,503-second TTL on this answer is more than five and a half hours left on a cached alias. Aliases that rarely change can be cached for a long time, while the addresses behind them stay short-lived and flexible.

A u.s. mail mailbox stands outdoors

Mail: MX, including the null MX

Normal mail routing

RFC 1035 describes MX simply as “mail exchange.” wikipedia.org listed two mail servers at equal priority:

wikipedia.org  MX  ttl300  10 mx-in1001.wikimedia.org.
wikipedia.org  MX  ttl300  10 mx-in2001.wikimedia.org.

The number is a preference: senders try the lowest first, and spread mail between servers that share the same value. Two servers at priority 10 means either is acceptable.

The null MX

example.com’s answer looked very different:

example.com  MX  ttl300  0 .

RFC 7505, published in June 2015, defines this as a “Null MX”: a record with “preference number 0 and a zero-length label, written in master files as ‘.'” It “formalizes the existing mechanism by which a domain announces that it accepts no mail.” Sending servers that see it give up immediately instead of retrying for days.

Why it matters for small domains

Many domains exist only for a website. Without a null MX, a sending server falls back to trying the domain’s address records as a mail server and keeps retrying. Publishing one is a cheap way to say “no mail here” clearly, and it also discourages spammers from forging that domain as a sender.

The zone itself: NS and SOA

Who answers for the domain

RFC 1035 defines NS as “an authoritative name server.” example.com named two:

example.com  NS  ttl21600  elliott.ns.cloudflare.com.
example.com  NS  ttl21600  hera.ns.cloudflare.com.

These are the servers that hold the domain’s records. Everything else in this post came, ultimately, from them. The six-hour TTL reflects how rarely a domain changes name servers.

Start of authority

The SOA record “marks the start of a zone of authority”:

example.com  SOA  elliott.ns.cloudflare.com. dns.cloudflare.com. 2421050422 10000 2400 604800 1800

The fields, in order, are the primary name server, a contact mailbox written as a name (the first dot stands for the @), the zone’s serial number, then four timers in seconds: how often secondary servers check for changes, how soon they retry after a failure, when they give up on stale data, and how long resolvers may cache a “no such record” answer, here 30 minutes. That last value explains why a newly added record sometimes takes a while to appear for someone who looked it up a moment too early.

A vintage padlock hangs on a wooden surface

Checking records yourself

With dig

On Linux and macOS, the dig tool asks the same questions from a terminal. The type goes after the name, and +short trims the answer to the data alone:

dig example.com A +short
dig example.com MX +short
dig wikipedia.org CAA +short
dig -x 8.8.8.8 +short
dig example.com SOA @elliott.ns.cloudflare.com

The -x option builds the reverse name automatically. Adding @ and a server name sends the question straight to that server instead of the local resolver, which is how to check what the authoritative servers say without waiting for any cached copy to expire. On Windows, nslookup -type=MX example.com does the same basic job.

Before changing a record

The TTL is a promise about caching, so it pays to plan around it. Lowering a record’s TTL a day or two before moving a site to a new server means that, on moving day, resolvers everywhere will pick up the new address within minutes instead of hours. After the move settles, the TTL can go back up to reduce lookups.

Common mistakes

Three come up constantly. A missing trailing dot in a zone file turns mail.example.com. into mail.example.com.example.com, because names without the final dot are treated as relative. Two separate SPF records in TXT, instead of one combined record, break email authentication. And a CNAME added to a name that already has other records gets rejected or behaves unpredictably, since an alias is supposed to be the only record at its name. Looking up the result with dig right after a change catches all three.

Text, certificates and the newer types

TXT records

RFC 1035 calls TXT simply “text strings.” That openness made TXT the home for verification tokens and email authentication policies such as SPF and DMARC, covered in a separate post on this site. Most domains carry several. Because any service can ask a domain owner to publish a token as proof of control, TXT records tend to pile up over the years: old verification strings for tools nobody uses anymore, left in place because removing them feels risky. An occasional review of a domain’s TXT records, keeping only what’s still needed, makes the zone easier to understand and shrinks the size of every TXT answer.

CAA: who may issue certificates

RFC 8659, from November 2019, defines CAA records, which let a domain holder “specify one or more Certification Authorities (CAs) authorized to issue certificates.” wikipedia.org listed several:

wikipedia.org  CAA  0 issue "pki.goog"
wikipedia.org  CAA  0 issue "digicert.com"
wikipedia.org  CAA  0 issue "letsencrypt.org"
wikipedia.org  CAA  0 iodef "mailto:dns-admin@wikimedia.org"

A certificate authority not on the list is required to refuse to issue a certificate for that domain. The iodef entry gives an address for reporting refused requests.

HTTPS records

The newest type here comes from RFC 9460, published in November 2023. It says “The HTTPS RR is a variation of SVCB for use with HTTP.” cloudflare.com’s answer included alpn=h3,h2 and lists of IPv4 and IPv6 address hints. The RFC explains that the address hint keys “convey IP addresses that clients MAY use to reach the service.” The ALPN list tells a browser, before it connects, that the site speaks HTTP/3 and HTTP/2, so it can try HTTP/3 straight away instead of discovering it on a second visit.

Reverse lookups: PTR

A PTR record, “a domain name pointer” in RFC 1035, maps an address back to a name. Looking up 8.8.8.8 in reverse, written as 8.8.8.8.in-addr.arpa, returned dns.google.. Reverse records are controlled by whoever owns the IP address block, not by the domain owner, which is why setting one usually means asking a hosting provider.

Sources

  • RFC 1035, “Domain Names – Implementation and Specification,” P. Mockapetris, November 1987: https://www.rfc-editor.org/rfc/rfc1035
  • RFC 7505, “A ‘Null MX’ No Service Resource Record for Domains That Accept No Mail,” June 2015: https://www.rfc-editor.org/rfc/rfc7505
  • RFC 8659, “DNS Certification Authority Authorization (CAA) Resource Record,” November 2019: https://www.rfc-editor.org/rfc/rfc8659
  • RFC 9460, “Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records),” November 2023: https://www.rfc-editor.org/rfc/rfc9460
  • Google Public DNS, “JSON API for DNS over HTTPS (DoH)”: https://developers.google.com/speed/public-dns/docs/doh/json

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *