DNS records explained: A, AAAA, CNAME, MX, TXT and NS
DNS records are the instructions that tell the internet where your website and email live. This guide gives you DNS records explained in plain language: what the A, AAAA, CNAME, MX, TXT and NS records do, with simple examples, what TTL means, and the typical record setups for a website on hosting and email on Google Workspace or Zoho Mail. If you already know the record types and just want the steps to edit them, see How to manage DNS records.
What is DNS, in one minute?
Computers find each other using IP addresses like 203.0.113.10. People prefer names like yourcompany.com. DNS (Domain Name System) is the "phone book" that translates names into the addresses and services behind them. Each domain has a DNS zone: a list of records, each with a name (host), a type, a value and a TTL.
The main record types at a glance
| Type | What it does | Example value |
|---|---|---|
| A | Points a name to an IPv4 address | yourcompany.com → 203.0.113.10 |
| AAAA | Points a name to an IPv6 address | yourcompany.com → 2001:db8::10 |
| CNAME | Makes a name an alias of another name | www → yourcompany.com |
| MX | Says which servers receive email for the domain, with a priority | 10 mail.yourcompany.com |
| TXT | Holds text, used for SPF, DKIM, DMARC and verification | v=spf1 include:_spf.google.com ~all |
| NS | Says which nameservers are authoritative for the domain | ns1.example-dns.com |
A record
The A record is the most basic: it connects a name to an IPv4 address. The record for the root domain (often shown as @ or the domain name itself) is what makes yourcompany.com open your website. You can also create A records for subdomains, e.g. shop.yourcompany.com pointing to another server.
AAAA record
The same as an A record, but for IPv6 addresses. You only need it if your server has an IPv6 address. If you add a wrong AAAA record, some visitors on IPv6 networks may not reach your site, so remove AAAA records you are not sure about.
CNAME record
A CNAME says "this name is the same as that name". It is commonly used for www (pointing to the root domain) or to connect services such as a store platform or email verification. Rules to remember:
- A CNAME points to a name, never to an IP address.
- A name that has a CNAME cannot have other records with the same name.
- The root domain (
@) normally cannot be a CNAME; use an A record there.
MX record
MX (Mail Exchanger) records tell other mail servers where to deliver email for @yourcompany.com. Each MX has a priority: the lowest number is tried first, and higher numbers are backups. An MX must point to a hostname, not to an IP address or a CNAME. If your MX records point to the wrong place, email silently goes there instead of your mailboxes.
TXT record
TXT records store text that other services read. The most common uses are:
- SPF: lists who may send email for your domain, e.g.
v=spf1 include:_spf.google.com ~all. A domain must have only one SPF record; merge entries into it instead of adding a second. - DKIM: a public key that lets receivers verify your email signature (usually on a name like
selector._domainkey). - DMARC: a policy on the name
_dmarc, e.g.v=DMARC1; p=none; rua=mailto:dmarc@yourcompany.com. - Verification: Google, Zoho, Microsoft and others ask you to add a TXT value to prove you own the domain.
More on SPF, DKIM and DMARC in Why does my email go to spam? SPF, DKIM and DMARC.
NS record
NS records name the nameservers that hold your DNS zone. Whoever controls these nameservers controls all the other records. If your domain uses EgWeb's nameservers, you edit records in cPanel; if it uses Cloudflare's nameservers, you edit them in Cloudflare. Changes made in the "wrong" place have no effect. See How to point your domain to your hosting.
What is TTL?
TTL (Time To Live) is how long, in seconds, other servers may cache a record before asking again. 3600 means one hour. A lower TTL makes future changes spread faster; a higher TTL reduces lookups. Tip: lower the TTL a day before a planned move, then raise it again afterwards. Why changes are not instant is explained in Why DNS changes take time (DNS propagation).
Typical setups
Website and email on EgWeb hosting
- A
@→ your hosting server IP - CNAME
www→yourcompany.com(or an A record to the same IP) - MX
@→mail.yourcompany.com(or the value cPanel creates) - TXT
@→ SPF including your hosting server, plus DKIM from cPanel
Website on hosting, email on Google Workspace
- A and
wwwrecords stay pointed at your hosting. - Replace the old MX records with the MX values shown in your Google Admin console, and delete the hosting MX.
- TXT for Google verification, SPF with
include:_spf.google.com, and the DKIM key generated in Google Admin.
Website on hosting, email on Zoho Mail
- A and
wwwrecords stay pointed at your hosting. - MX records as shown in your Zoho admin console (for example
mx.zoho.com,mx2.zoho.com,mx3.zoho.com– the exact names depend on your Zoho data centre). - TXT for Zoho verification, SPF and DKIM as provided by Zoho.
Where to edit DNS records
- cPanel → Zone Editor: if your domain uses the hosting nameservers. Use Manage next to the domain to add, edit or delete A, CNAME, MX and TXT records.
- Cloudflare → DNS: if your domain uses Cloudflare nameservers. Note that records related to email (such as
mail) should be set to DNS only, not proxied, otherwise mail apps cannot connect.
Step-by-step instructions are in How to manage DNS records.
Frequently asked questions
What is the difference between an A record and a CNAME?
An A record points directly to an IP address. A CNAME points to another name, which is then resolved to an IP.
Can I have two SPF records?
No. Two SPF records make SPF fail. Combine all senders into one record, e.g. v=spf1 a mx include:_spf.google.com ~all.
Why did my change not work?
Either the old value is still cached (wait for the TTL), or you edited the zone at a provider that is not your active nameserver.
What does @ mean in a DNS record?
@ stands for the root domain itself, e.g. yourcompany.com without any subdomain.
Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.