WHAT'S NEW
Domains & DNS · GuideGuides › Domains & DNS

DNS Records Decoded: A, CNAME, MX, TXT and NS

Understand the five DNS records you'll meet most, what each one does, and how to read a DNS settings page without guessing.

📶 Beginner⏱ 9 min🗓 Updated November 17, 2026❤ 0
dns-zone.txt
@     A      203.0.113.10
www   CNAME  example.com.
@     MX 10  mail.example.com.
@     TXT    "v=spf1 include:..."
// Before you start

🧰 What you need first

  • A domain you own, or one you'd like to understand

🎯 What you'll learn

  • Know what A, AAAA, CNAME, MX, TXT and NS records do
  • Read the Host, Value and TTL columns
  • Know which record a host or service is asking for

🛠 Tools needed

  • Your registrar or DNS provider account
01 / Start here

DNS is the internet's address book

Computers find each other with numbers called IP addresses. People prefer names. DNS (Domain Name System) connects the two: when someone types your domain, DNS tells their browser where to go.

Your DNS settings are a short list of records. Each record is one instruction.

02 / Reading the table

Host, Type, Value, TTL

  • Host (or Name): which name the record is for. @ means the domain itself (example.com). www means www.example.com.
  • Type: the kind of record, like A or MX.
  • Value (or Points to): where it sends people.
  • TTL: how long other computers may remember the answer, in seconds.
03 / The records

The five you'll meet most

A and AAAA: name to address

An A record points a name to an IPv4 address like 203.0.113.10. An AAAA record does the same for newer IPv6 addresses. Your host gives you these numbers.

CNAME: name to another name

A CNAME says "this name is really that name". It's common for www, which often points to your main domain or to a service like a store or website builder.

Note: a regular CNAME can't be used on the domain itself (@). Some DNS providers offer a stand-in called ALIAS, ANAME or CNAME flattening for that.

MX: where email goes

MX records tell other mail servers where to deliver email for your domain. Each one has a priority number: the lower number is tried first.

TXT: notes for other services

TXT records hold text that services read to verify you own the domain, and to protect your email (SPF, DKIM and DMARC).

NS: who's in charge

NS records name the nameservers, the company that answers DNS questions for your domain. If you change nameservers, the records at the new company are the ones that count.

Warning: if your nameservers point to your host, edits on your registrar's DNS page do nothing. Always edit DNS where your nameservers point.

04 / Example

A typical small-business setup

@     A      203.0.113.10        (website)
www   CNAME  example.com.        (www goes to the same site)
@     MX 10  mx1.mailhost.com.   (email)
@     TXT    "v=spf1 include:mailhost.com ~all"  (email security)

Tip: the dot at the end of names like example.com. is normal. Many DNS pages add it for you, so you can usually leave it off.

05 / Help

FAQ and common problems

What TTL should I use?

The default (often 3600 seconds, one hour) is fine. Lower it to 300 a day before a planned change so the switch happens faster.

Can I have two A records for the same name?

Yes, some services use several for backup. Only add what your host or service tells you to.

The DNS page won't let me add a CNAME for @

Why: Standard DNS doesn't allow a CNAME on the domain itself.
Fix: Use the A record your host gives you, or the ALIAS / flattening option if your DNS provider has one.

I added a record but nothing changed

Why: You may be editing DNS at the wrong company, or the old answer is still remembered.
Fix: Check which nameservers your domain uses, then see Why DNS Changes Take Time.

// Recap

Key takeaways

A points a name to an IPv4 address (AAAA is IPv6)
CNAME points a name to another name
MX says where email is delivered
TXT holds verification and email security text
NS says which company answers for your DNS
// What's next

Keep going

Enjoyed this guide?

Support free learning at mC0de.

PIX0
</> {} JS 01
0101 </> CSS JS HTML PIX0 const {} 1010 async mC0de function return 0101 <div> 1010 PIX0 CSS JS HTML const {} 0101 mC0de
PIX0 // WORLD OF CODE
PIX0 IS PREPARING SOMETHING AWESOME FOR YOU 0%