DNS Record Types Explained, With Examples

A DNS record is one line in a domain's zone that answers a specific question. A records give an IPv4 address, AAAA records give an IPv6 address, CNAME makes a name an alias of another, MX names the mail servers, TXT holds verification text, NS delegates the zone and CAA limits which authorities may issue certificates.

The records most sites need
JobRecordExample value
Point the root domain at a serverA / AAAA203.0.113.10 / 2001:db8::10
Point www at a hosting providerCNAMEsites.example-host.net.
Receive emailMX10 mail.example.com.
Prove ownership, publish SPFTXT"v=spf1 include:_spf.example.net ~all"
Choose your DNS providerNSns1.example-dns.net.

Updated

Hosting providers, mail services and certificate authorities all ask you to add records with terse names. This page explains each type in plain words, links the RFC that defines it, and builds the lines you paste into your registrar when you connect a domain to a site.

DNS record reference

Common record types
TypePurposeDefined inExample
AMaps a name to an IPv4 addressRFC 1035example.com. 3600 IN A 203.0.113.10
AAAAMaps a name to an IPv6 addressRFC 3596example.com. 3600 IN AAAA 2001:db8::10
CNAMEMakes a name an alias of another nameRFC 1035www.example.com. 3600 IN CNAME sites.example-host.net.
MXLists mail servers with a preference, lower firstRFC 1035example.com. 3600 IN MX 10 mail.example.com.
TXTFree text, used for SPF, DKIM, DMARC and ownership checksRFC 1035example.com. 3600 IN TXT "v=spf1 include:_spf.example.net ~all"
NSNames the authoritative nameservers for the zoneRFC 1035example.com. 86400 IN NS ns1.example-dns.net.
SOAMarks the start of the zone: primary server, contact, serial and timersRFC 1035example.com. 3600 IN SOA ns1.example-dns.net. admin.example.com. 2026101401 7200 3600 1209600 300
CAALimits which certificate authorities may issue for the nameRFC 8659example.com. 3600 IN CAA 0 issue "letsencrypt.org"
SRVGives host and port for a named service and protocolRFC 2782_sip._tcp.example.com. 3600 IN SRV 10 5 5060 sip.example.com.
PTRMaps an address back to a name (reverse lookup)RFC 103510.113.0.203.in-addr.arpa. 3600 IN PTR server.example.com.

A complete small zone file

This is what a typical small business zone looks like in the standard text format, with a site on a host and mail on a separate provider.

Zone for a site plus email

The @ sign stands for the root domain. Names ending in a dot are complete; others get the zone name appended.

$ORIGIN example.com.
$TTL 3600
@      IN A      203.0.113.10
@      IN AAAA   2001:db8::10
www    IN CNAME  sites.example-host.net.
@      IN MX 10  mx1.example-mail.net.
@      IN MX 20  mx2.example-mail.net.
@      IN TXT    "v=spf1 include:_spf.example-mail.net ~all"
_dmarc IN TXT    "v=DMARC1; p=none; rua=mailto:[email protected]"
@      IN CAA    0 issue "letsencrypt.org"

CAA tags

CAA property tags defined in RFC 8659
TagWhat it controls
issueWhich authorities may issue ordinary certificates for the name
issuewildWhich authorities may issue wildcard certificates; overrides issue for wildcards
iodefWhere an authority may report a refused request, as a mailto: or https: address

Records for connecting a domain to a website

Most hosts give you two instructions: an address for the root domain and a target name for www. The address becomes an A record (and an AAAA record if they publish IPv6), and the target becomes a CNAME on www.

If your host asks you to change nameservers instead, you replace the NS records at the registrar and the host manages every record from then on. That moves email records too, so copy your MX and TXT lines across first.

Email records travel together

MX records say which servers accept mail, with a preference number where lower is tried first. SPF, DKIM and DMARC are all published as TXT records at specific names.

When you switch website hosts, leave the mail records alone. A common outage comes from deleting MX lines while tidying up the web records.

How it works

  1. Search or filter the record table by name or by job, such as mail or security.
  2. Open the record builder, type your domain and your host's address or target, and copy the generated lines.
  3. Paste the values into the DNS panel at your registrar or DNS provider, one record per row.
  4. Check the result with a DNS lookup once the old records' TTL has passed.

Tips

Frequently asked questions

What is a DNS A record?

An A record maps a name to one 32 bit IPv4 address, such as 203.0.113.10. Browsers use it to find the server for your domain. A name can hold several A records, and resolvers return them all.

What is an AAAA record and do I need one?

AAAA is the IPv6 version of the A record, defined in RFC 3596 as type 28, holding a 128 bit address. Add it when your host gives you an IPv6 address, so visitors on IPv6 networks reach you directly.

Can I use a CNAME on my root domain?

Not as a standard record. RFC 1034 says no other data should sit at a node that has a CNAME, and the root always carries SOA and NS records. Some DNS providers offer flattening or ALIAS records that act like a CNAME at the root.

How long do DNS changes take?

Resolvers keep an answer for the TTL set on the old record. If that was 3600 seconds, some visitors may see the old value for up to an hour after you change it.

What does a PTR record do?

A PTR record maps an IP address back to a name, used in reverse lookups. It lives in a zone run by whoever owns the IP range, usually your server or mail provider, not in your domain's zone.

Related: DNS lookup tool, DNS propagation checker, How to add a custom domain, Domain vs hosting, SSL certificate types.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap