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.
| Job | Record | Example value |
|---|---|---|
| Point the root domain at a server | A / AAAA | 203.0.113.10 / 2001:db8::10 |
| Point www at a hosting provider | CNAME | sites.example-host.net. |
| Receive email | MX | 10 mail.example.com. |
| Prove ownership, publish SPF | TXT | "v=spf1 include:_spf.example.net ~all" |
| Choose your DNS provider | NS | ns1.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.
| Type | Purpose | Defined in | Example |
|---|---|---|---|
| A | Maps a name to an IPv4 address | RFC 1035 | example.com. 3600 IN A 203.0.113.10 |
| AAAA | Maps a name to an IPv6 address | RFC 3596 | example.com. 3600 IN AAAA 2001:db8::10 |
| CNAME | Makes a name an alias of another name | RFC 1035 | www.example.com. 3600 IN CNAME sites.example-host.net. |
| MX | Lists mail servers with a preference, lower first | RFC 1035 | example.com. 3600 IN MX 10 mail.example.com. |
| TXT | Free text, used for SPF, DKIM, DMARC and ownership checks | RFC 1035 | example.com. 3600 IN TXT "v=spf1 include:_spf.example.net ~all" |
| NS | Names the authoritative nameservers for the zone | RFC 1035 | example.com. 86400 IN NS ns1.example-dns.net. |
| SOA | Marks the start of the zone: primary server, contact, serial and timers | RFC 1035 | example.com. 3600 IN SOA ns1.example-dns.net. admin.example.com. 2026101401 7200 3600 1209600 300 |
| CAA | Limits which certificate authorities may issue for the name | RFC 8659 | example.com. 3600 IN CAA 0 issue "letsencrypt.org" |
| SRV | Gives host and port for a named service and protocol | RFC 2782 | _sip._tcp.example.com. 3600 IN SRV 10 5 5060 sip.example.com. |
| PTR | Maps an address back to a name (reverse lookup) | RFC 1035 | 10.113.0.203.in-addr.arpa. 3600 IN PTR server.example.com. |
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.
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"| Tag | What it controls |
|---|---|
| issue | Which authorities may issue ordinary certificates for the name |
| issuewild | Which authorities may issue wildcard certificates; overrides issue for wildcards |
| iodef | Where an authority may report a refused request, as a mailto: or https: address |
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.
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.
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.
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.
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.
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.
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.
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.