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.
| 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.
DNS record reference
| 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. |
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
| 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 |
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
- Search or filter the record table by name or by job, such as mail or security.
- Open the record builder, type your domain and your host's address or target, and copy the generated lines.
- Paste the values into the DNS panel at your registrar or DNS provider, one record per row.
- Check the result with a DNS lookup once the old records' TTL has passed.
Tips
- A name that carries a CNAME may not carry any other record, so the bare root domain usually needs A and AAAA records, or a provider feature that flattens the alias.
- Lower the TTL to a few minutes a day before a move, then raise it again once the new values are confirmed.
- Keep exactly one SPF TXT record per name. Two separate v=spf1 records make the check fail.
- Add a CAA record naming the certificate authority your host uses, or leave CAA out entirely, so renewals are not blocked.
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.
Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.
More in Guides
- DNS Server Not Responding: Step-by-Step Fixes
- Do I Need a Website for My Business? A Decision Worksheet | How-to Guide
- Docker Compose env_file, environment and .env: Which Does What
- Domain Forwarding: Send One Domain to Another the Right Way
- Domain Management for Agencies: Ownership, Access and Renewals Without the 2 a.m. Outage | How-to Guide
- Domain vs Hosting: What Is a Domain Name and How Is It Different? | How-to Guide
- Double Opt-In: The Confirm-Your-Email Step
- Duplicate Without User-Selected Canonical (and Alternate Page With Proper Canonical Tag)
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App