Home / Guides / DNS records guide

DNS Records Explained

What each DNS record type does, how a name is resolved, how TTL and propagation work, and the mistakes that break websites and email.

Check any domain now with the DNS lookup.

What DNS does

DNS, the Domain Name System, turns names that people use into the data that computers need, mostly IP addresses. It is a worldwide database in which every domain owner controls the records of their own domain.

The main record types

TypePurposeExample value
AName to IPv4 address93.184.216.34
AAAAName to IPv6 address2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias of another nameshops.example.net.
MXMail server and priority10 mail.example.com.
TXTText: SPF, DKIM, DMARC, verification"v=spf1 include:_spf.example.net ~all"
NSAuthoritative name servers of the zonens1.example.com.
SOAZone data: primary server, serial, timersns1.example.com. admin.example.com. 2024010101 7200 3600 1209600 300
CAACertificate authorities allowed to issue certificates0 issue "letsencrypt.org"
SRVHost and port of a service10 5 5060 sip.example.com.
PTRIP address to name (reverse DNS)host.example.com.

How a name is resolved

  1. Your device asks its resolver, usually run by your internet provider or a public service, for www.example.com.
  2. If the resolver has no fresh answer, it asks a root server, which points to the servers of the .com zone.
  3. The .com servers point to the name servers of example.com, the authoritative servers.
  4. The authoritative server answers with the record. The resolver passes it on and keeps a copy for the TTL of the record.

TTL and propagation

The TTL (time to live) is the number of seconds that a resolver may keep an answer. A TTL of 3600 means one hour. There is no worldwide "propagation" in the sense of a push: when you change a record, each resolver simply keeps showing the old answer until its copy expires. That is why you should lower the TTL before a planned change, and raise it again afterwards.

Typical setups

example.com.        300   IN A      93.184.216.34
www.example.com.    300   IN CNAME example.com.
example.com.       3600   IN MX     10 mail.example.com.
example.com.       3600   IN TXT    "v=spf1 mx -all"
_dmarc.example.com. 3600  IN TXT    "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"
example.com.       3600   IN CAA    0 issue "letsencrypt.org"

Common mistakes

  • A CNAME at the root. The root of a domain needs NS and SOA records, and a CNAME cannot share a name with other records. Use an A record, or an ALIAS or flattened CNAME.
  • A CNAME next to other records on the same name, such as a CNAME and an MX.
  • Two SPF records. Only one TXT record may start with v=spf1.
  • MX pointing to an IP or a CNAME. It must point to a host name with an A or AAAA record.
  • A trailing dot problem. In a zone file, a name without a final dot gets the domain added. Some providers want the dot, and some forbid it.
  • Editing at the wrong provider. Only the provider named in your NS records controls the zone.
  • A forgotten AAAA record that sends IPv6 visitors to an old server.

Check records from the command line

dig example.com A
dig +short example.com MX
dig example.com TXT @1.1.1.1
dig example.com NS
dig -x 93.184.216.34

nslookup -type=MX example.com
Resolve-DnsName example.com -Type TXT

Use dig @ns1.example.com example.com to ask an authoritative server directly and skip every cache.

Tools on this site

Frequently asked questions

What are the most common DNS record types?

A and AAAA for addresses, CNAME for aliases, MX for mail, TXT for text such as SPF and DKIM, NS for name servers and SOA for zone information.

What is TTL in DNS?

It is the time in seconds that a resolver may keep an answer before asking again. Low values make changes visible faster.

Why can I not use a CNAME on my root domain?

The root must hold NS and SOA records, and a CNAME cannot share a name with other records. Use an A record or an ALIAS or flattened CNAME.

How long does a DNS change take?

Until the old TTL runs out. It can be a few minutes with a low TTL, or a day or more with a high one.