NetSecTools

Home / Guides / DNS records explained: A, AAAA, CNAME, MX, TXT, NS and CAA

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

· 9 min read

The Domain Name System (DNS) is the internet’s phone book. It turns a name like example.com into the information computers need: where the website lives, where to deliver mail, and which services are allowed to use the domain. That information is stored as records.

When something is wrong with a website or email, DNS is often the cause. Knowing the record types makes problems much easier to find.

How a lookup works

When you type an address, your device asks a recursive resolver, usually run by your internet provider or a public service. The resolver finds the answer by asking the servers that are authoritative for the domain, and remembers it for a while. The answer says which records exist, and each record has a TTL that says how long it may be kept.

A and AAAA: the address of a server

  • A maps a name to an IPv4 address, for example 93.184.216.34.
  • AAAA maps a name to an IPv6 address, for example 2606:2800:220:1:248:1893:25c8:1946.

A name can have several of each. Browsers and apps pick one, which spreads traffic across servers.

CNAME: an alias to another name

A CNAME says “this name is another name for that one”. For example, www.example.com can point to example.com, or a shop at shop.example.com can point to the hostname of a hosting platform.

Rules to remember:

  • A name that has a CNAME cannot have any other record at the same name.
  • Because the root of a domain (example.com) must also hold NS, SOA and usually MX records, a CNAME is not allowed at the root. Some providers offer “CNAME flattening” or an ALIAS record to work around this.

MX: where email is delivered

MX records list the mail servers for the domain, each with a priority. A lower number is tried first:

10 mx1.example.com
20 mx2.example.com

If the first server is unreachable, senders try the next. An MX record must point to a name, never directly to an IP address, and that name must have an A or AAAA record.

TXT: text with a purpose

TXT records hold arbitrary text, and they are used for many things:

  • SPF (v=spf1 ...): lists the servers allowed to send mail for the domain.
  • DKIM (selector._domainkey): publishes the public key used to sign mail.
  • DMARC (_dmarc): publishes the policy for messages that fail checks.
  • Domain verification: services ask you to add a TXT record to prove you own a domain.

A domain can have many TXT records at its root, but only one SPF record. For details, see our guide to SPF, DKIM and DMARC.

NS: who is in charge

NS records name the authoritative DNS servers for the domain. They are set both at your DNS host and at your registrar. If they do not match where your records live, nothing you change will take effect.

SOA: the zone’s header

The SOA record holds administrative details about a zone: the primary name server, a contact, a serial number that changes with each update, and timers for how secondary servers refresh. You rarely edit it by hand.

CAA: who may issue certificates

CAA records list the certificate authorities permitted to issue TLS certificates for your domain:

0 issue "letsencrypt.org"

If a different authority is asked to issue one, it must refuse. This reduces the chance of a rogue certificate.

PTR: from address back to name

PTR records are used for reverse DNS: they map an IP address back to a name. They live under special domains such as in-addr.arpa, and they are set by whoever controls the IP address, usually your provider. Mail servers often check them.

TTL and “propagation”

Every record has a TTL (time to live), in seconds. It tells resolvers how long they may reuse the answer before asking again.

  • A TTL of 300 means five minutes. A TTL of 86400 means a day.
  • When you change a record, resolvers that cached the old value keep serving it until it expires.

People call this delay “propagation”, but nothing is actually being pushed around the internet. You are simply waiting for old cached answers to expire. If you plan a change, lower the TTL a day or two beforehand, make the change, and raise it again afterwards.

DNSSEC

DNSSEC adds digital signatures to DNS answers so that resolvers can detect forged data. It protects against tampering with the answers, but it does not encrypt anything. It needs support from your registrar and DNS host. Our DNS Lookup shows whether the answer for a domain was validated.

Troubleshooting checklist

  1. Website does not load: check that the A or AAAA records point to the right server and that the CNAME target exists.
  2. www works but the bare domain does not, or the other way round: one of the two names is missing a record.
  3. Email is not arriving: check the MX records and their priorities, and make sure the target names resolve.
  4. Email lands in spam: check SPF, DKIM and DMARC. Our Email Security Checker does this for you, and the SPF & DMARC generator builds correct records.
  5. A change does not show up: compare the TTL, and confirm the NS records match the provider where you edited.
  6. Certificate cannot be issued: look at the CAA records.
  7. Domain verification keeps failing: make sure the TXT record is at the exact name requested, and without extra quotes or spaces.

Look up any record

Enter a domain in our DNS Lookup to see its A, AAAA, CNAME, NS, MX, TXT, SOA and CAA records, together with the TTL and whether DNSSEC validated the answer. It queries public DNS-over-HTTPS resolvers directly from your browser.