DNS Record Types Explained (A, CNAME, MX, TXT & More)
A plain-English guide to every DNS record type — A, AAAA, CNAME, MX, TXT, NS, SOA, CAA, and PTR — with real examples and how to look each one up for any domain.
Every domain on the internet is run by a small set of DNS records — the instructions that tell the world where your website lives, where your email should go, and which services are allowed to act on your behalf. Get one wrong and your site goes down or your email stops arriving.
This guide explains the DNS record types you'll actually deal with — with real examples and how to look each one up for any domain. Whether you're pointing a domain at new hosting, setting up email, or debugging an outage, these are the records that matter.
The anatomy of a DNS record
Before the types, it helps to see the shape they all share. Every record has four parts:
- Name — the hostname it applies to (
example.comorwww.example.com). - Type — what kind of record it is (
A,MX,TXT…). - TTL — time to live, in seconds: how long resolvers may cache it before checking again.
- Value — the answer (an IP address, another hostname, or text).
A real record looks like this:
example.com. 3600 IN A 203.0.113.10
# name TTL class type valueA and AAAA records — where the site lives
An A record maps a hostname to an IPv4 address — this is what turns example.com into a server your browser can reach. An AAAA record does the same for IPv6 addresses.
example.com. A 203.0.113.10
example.com. AAAA 2001:db8::1If an A record is missing or wrong, visitors get errors like DNS_PROBE_FINISHED_NXDOMAIN because the name has nowhere to point.
CNAME record — an alias to another name
A CNAME record (canonical name) points one hostname at another hostnameinstead of an IP address. It's how you point www.example.com at example.com, or a subdomain at a SaaS provider.
www.example.com. CNAME example.com.
shop.example.com. CNAME mystore.myshopify.com.The apex CNAME rule
example.com itself) — only on subdomains. For the apex, use an A record (or a provider's ALIAS/ANAME). This trips up a lot of first-time domain setups.MX record — where email goes
An MX record (mail exchange) tells other mail servers where to deliver email for your domain. Each has a priority — lower numbers are tried first.
example.com. MX 10 mail1.example.com.
example.com. MX 20 mail2.example.com.Using Google Workspace or Microsoft 365? Your MX records point at their servers. If email suddenly stops, a changed or missing MX record is the first thing to check.
TXT record — verification, SPF, DKIM, DMARC
A TXT recordholds arbitrary text, and it's become the workhorse of domain configuration. The most common uses:
- Domain verification — proving ownership to Google, Microsoft, or other services.
- SPF — listing which servers may send email as your domain.
- DKIM & DMARC — signing and policy records that keep your mail out of spam folders.
example.com. TXT "v=spf1 include:_spf.google.com ~all"
example.com. TXT "google-site-verification=abc123..."NS and SOA records — who runs the zone
NS records (name server) say which DNS servers are authoritative for your domain — i.e. which servers hold the real answers. If your NS records point at the wrong provider, none of your other records take effect.
The SOA record (start of authority) sits at the top of every zone with administrative details: the primary name server, the admin contact, and timers for how secondary servers refresh.
example.com. NS ns1.provider.com.
example.com. NS ns2.provider.com.CAA and PTR records — certificates and reverse DNS
A CAA record (certification authority authorization) lists which certificate authorities are allowed to issue SSL certificates for your domain — a useful guardrail against mis-issuance.
example.com. CAA 0 issue "letsencrypt.org"A PTR record does the reverse of an A record: it maps an IP address back to a hostname (reverse DNS), which mail servers check to help fight spam.
How to look up DNS records for any domain
The quickest way to see every record for a domain is our free DNS Checker — enter a domain and it lists the A, AAAA, CNAME, MX, TXT, NS, SOA, and CAA records at once. From a terminal you can query a specific type with dig:
dig example.com A +short
dig example.com MX +short
dig example.com TXT +short
dig www.example.com CNAME +shortOr with nslookup on Windows:
nslookup -type=MX example.com
nslookup -type=TXT example.comCheck from a public resolver
@1.1.1.1 to a digcommand to query Cloudflare's public resolver directly. That shows you what the rest of the world sees — useful when a change you just made looks fine on your machine but not to visitors.Keep an eye on the records that matter
DNS records are quiet until they're not. A changed A record can take your site offline, a deleted MX record silently drops your email, and an unexpected NS change can signal a domain hijack — and none of these throw an obvious alarm.
Uptura's DNS monitoring snapshots your A, AAAA, CNAME, MX, TXT, and NSrecords and alerts you the moment any of them change — so you find out before your visitors or your inbox do. It's free during our public beta.
Debugging a specific DNS problem right now? See our guides on “DNS server not responding” and DNS_PROBE_FINISHED_NXDOMAIN.