DNS Records Explained: A, CNAME, MX, and TXT for Beginners
Your domain's DNS settings page is a table of cryptic records. What A, AAAA, CNAME, MX, TXT, and NS records do, how subdomains work, what TTL means, why changes 'take time to propagate', and how to check what the world actually sees.
You bought a domain. Your host says "add these DNS records." You open your registrar's DNS page and find a table with columns like Type, Name, Value, and TTL, and a dropdown of options you've never heard of. This guide explains what's in that table.
What DNS does
Computers find each other by IP address — numbers like 203.0.113.42. People prefer names like yourapp.com. The Domain Name System (DNS) is the internet's directory that turns one into the other.
When someone types your domain, their computer asks DNS "where is yourapp.com?" and gets back an answer. DNS records are the entries you control that decide what that answer is. (What Is a Domain Name? covers buying and owning the name itself.)
The records you'll actually use
A record — "this name is at this IP address"
Type Name Value
A @ 203.0.113.42
@ means the domain itself (yourapp.com). An A record points a name at an IPv4 address. If your host gives you an IP address, this is the record to add.
AAAA ("quad-A") is the same thing for the newer, longer IPv6 addresses like 2001:db8::1.
CNAME — "this name is an alias for that name"
Type Name Value
CNAME www yourapp.hosting-provider.com
A CNAME says "for www.yourapp.com, go look up this other name instead." Hosts often give you a CNAME target rather than an IP, so they can change their IPs without you touching anything.
One rule catches people out: a CNAME can't sit on the root domain (@) alongside other records. That's why many hosts ask for an A record on yourapp.com and a CNAME on www. Some DNS providers offer a workaround called ALIAS, ANAME, or CNAME flattening for the root.
MX — "email for this domain goes here"
Type Name Value Priority
MX @ mx1.email-provider.com 10
MX @ mx2.email-provider.com 20
MX records tell other mail servers where to deliver email addressed to [email protected]. Lower priority numbers are tried first. Your email provider tells you exactly what to add. (How to Get a Custom Email Address for Your Domain.)
TXT — "a note for other services to read"
Type Name Value
TXT @ "v=spf1 include:_spf.email-provider.com ~all"
TXT @ "google-site-verification=abc123..."
TXT records hold text. They're how you prove you own a domain (to Google, to an email service, to a certificate authority) and how you publish email-security settings like SPF, DKIM, and DMARC, which stop your emails landing in spam. (How to Send Email From Your App Without Landing in Spam.)
NS — "these servers are in charge of this domain"
NS (name server) records say which company's servers hold your DNS records. By default, that's your registrar. If you move DNS to another provider — say, a CDN — you change the NS records at your registrar, and from then on you edit records at the new provider, not the old one.
This is the most common source of "I changed the record and nothing happened": you edited records at a provider that isn't in charge anymore.
Subdomains
A subdomain is anything to the left of your domain: www.yourapp.com, app.yourapp.com, api.yourapp.com, staging.yourapp.com. Each one is just a record with that name:
Type Name Value
CNAME app yourapp.hosting-provider.com
A api 203.0.113.50
CNAME staging staging.hosting-provider.com
Subdomains are free and unlimited. They're a clean way to separate your marketing site, your app, your API, and your test environment.
TTL and "propagation"
TTL (time to live) is how many seconds other computers may cache an answer before asking again. A TTL of 3600 means an hour.
That caching is why DNS changes seem to "take time to propagate." Nothing is spreading across the internet — computers that looked up the old answer are simply allowed to keep using it until their cached copy expires. New visitors usually see the change within minutes; some see the old answer until the TTL runs out.
Tip: before a planned change (like moving hosts), lower the TTL to 300 (five minutes) a day in advance. After the move, raise it again.
How to check what the world sees
Don't trust your own browser — it caches too. Check directly:
nslookup yourapp.com
dig yourapp.com A +short
dig www.yourapp.com CNAME +short
dig yourapp.com MX +short
dig works on macOS and Linux; nslookup works everywhere, including Windows. Online "DNS checker" sites show the answer from many locations at once — handy for seeing whether a change has reached everyone.
Common mistakes
- Leaving the old record in place. Two A records for
@pointing at different hosts means visitors randomly get one or the other. - Pasting the full domain into the Name field. Many providers add your domain automatically, so
www.yourapp.combecomeswww.yourapp.com.yourapp.com. Use justwww. - Editing at the wrong provider — check the NS records first.
- Deleting MX records while moving your website, and breaking email. Website records and email records are independent; only change the ones your host asked for.
EasySpawn tells you exactly which records to add when you connect your own domain, then issues SSL automatically once they resolve. You keep the domain at whichever registrar you like. See how it works or join the waitlist.
Related: How to Connect a Custom Domain to Your App · What Is HTTPS? · What Is an IP Address and a Port?
Keep reading
What Is Web Hosting? A Plain-English Guide for First-Time App Builders
Your app has to run on a computer that's always on and connected to the internet. That's hosting. The main kinds — static hosting, app hosting, servers you manage, and managed platforms — what each is for, and how to tell which one your app needs.
What Is Serverless? (There Are Still Servers)
Serverless means you write functions and the platform runs them on demand — no servers to manage, pay per use. What serverless really is, how it differs from an always-on server, cold starts, timeouts, and the database connection problem, and when it's the wrong fit.