whoistool
← All guides

DNS records explained: A, AAAA, CNAME, MX, TXT, NS and more

Last checked: Oct 20, 2026

DNS turns a name like example.com into the addresses and settings that browsers and mail servers need. Each piece of information is a record with a type. Knowing the dozen common types is enough to set up a website, e-mail and verification records without surprises.

In short

  • A and AAAA point a name to an IPv4 or IPv6 address; CNAME makes a name an alias of another name.
  • MX says which servers receive e-mail; TXT holds text such as SPF, DKIM, DMARC and verification codes.
  • NS records delegate the domain to its name servers; changing them moves your whole DNS elsewhere.
  • Changes are not pushed out anywhere; resolvers keep the old answer until its TTL runs out.

Common record types

TypeWhat it doesExample
AName → IPv4 addressexample.com A 203.0.113.10
AAAAName → IPv6 addressexample.com AAAA 2001:db8::10
CNAMEName → another name (alias)www CNAME example.com
MXMail servers, with a priority (lower is tried first)example.com MX 10 mail.example.com
TXTFree text: SPF, DKIM, DMARC, ownership verificationv=spf1 include:_spf.google.com ~all
NSThe domain's authoritative name serversexample.com NS ns1.provider.net
SOAZone details: primary server, serial number, timersCreated by your DNS provider
CAAWhich certificate authorities may issue SSL certificatesexample.com CAA 0 issue "letsencrypt.org"
SRVHost and port of services such as SIP or XMPP_sip._tcp SRV 10 5 5060 sip.example.com
PTRReverse DNS: IP → name; set by whoever owns the IP (your host)10.113.0.203.in-addr.arpa PTR mail.example.com

The rules that cause the most trouble

  • No CNAME at the root (example.com itself): the root also holds the NS and SOA records, and a CNAME cannot sit next to other records. Use A/AAAA at the root; many providers offer ALIAS/ANAME or CNAME flattening for this.
  • A name that has a CNAME can have no other records, so you cannot add MX or TXT to a subdomain that is a CNAME.
  • MX and NS records must point to a host name, never directly to an IP address or to a CNAME.
  • Only one SPF record per name; several TXT records for other purposes are fine.
  • In some control panels the trailing dot matters: mail.example.com. is a full name; without the dot the panel may append your domain and create mail.example.com.example.com.

TTL and “propagation”

Every record has a TTL (time to live) in seconds. Resolvers run by internet providers and public DNS services keep the answer in their cache for that long. When you change a record, those that already cached the old value keep using it until the TTL runs out. That is what people call DNS propagation.

Plan changes: a day before moving a website, lower the TTL of the records you will change to 300 seconds (5 minutes), and raise it back to 3600 or more afterwards. Changing name servers (NS) takes longer, because the NS records in the parent zone (for example .com) can have a TTL of up to two days, and some resolvers wait that long.

Negative answers are cached too: if you look a name up before creating it, the “no such name” answer can be kept for the negative TTL set in the zone's SOA record.

Typical setups

  • Website on a host: A (and AAAA, if available) for example.com, and www as a CNAME to example.com.
  • Google Workspace or Microsoft 365 mail: the MX records they give you, an SPF include, DKIM as CNAME/TXT and a DMARC record. Details in the SPF, DKIM and DMARC guide.
  • Verification for Google Search Console and similar services: a TXT record on the domain; it can sit next to SPF.
  • A subdomain for a SaaS service (shop, help desk): shop CNAME to the host name the provider gives you.

Check your records

Sources

This guide summarizes public information and is not legal advice. Rules can change; the official texts and announcements prevail.

Other guides