What’s the difference between CNAME, TXT and MX records ?

When you create a DNS record on Godaddy or Cloudflare or any other DNS provider, have you asked the question:
❓ What’s the difference between CNAME, TXT and MX records ❓

Here is the differences between these types of DNS records:

✅CNAME (Canonical Name) records:
– Used to create an alias from one domain name to another.
– For example, if you want “www.website.com” to point to “website.com”, you use a CNAME.
– Cannot be used on the root domain (apex domain).

✅TXT records:
– Allow you to add free text associated with a domain.
Often used for:
– Domain ownership verification (Google, Microsoft, etc.)
– SPF configuration for e-mail.
– Storing various configuration information.

✅MX (Mail Exchange) records:
– Specifically used for e-mail routing.
– Indicate which servers are responsible for receiving e-mail for your domain.
– Include a priority (a number) that determines the order in which mail servers should be contacted.

For example, if you use Google Workspace, you’ll have MXs pointing to Google mail servers.

A concrete example:

# CNAME for domaine name
CNAME www.website.ca website.com

# TXT for SPF
TXT domain.com “v=spf1 include:_spf.google.com ~all”

# MX for Gmail
MX domain.com 1 aspmx.l.google.com
MX domain.com 5 alt1.aspmx.l.google.com

Thanks

Aymen EL JAZIRI (Microsoft MVP)
Aymen EL JAZIRI (Microsoft MVP)

Hi, I’m Aymen El Jaziri , a passionate System Administrator and Microsoft MVP, with years of hands-on experience in managing and securing modern IT infrastructures.
This blog is where I share technical guides, automation scripts, product reviews, and real-world solutions that help IT professionals simplify their day-to-day work and stay ahead in a fast-evolving cloud ecosystem.
Whether you’re here to troubleshoot an issue, improve your automation game, or learn new best practices , welcome in my blog !
Let’s build a stronger, smarter IT community together.
Feel free to connect with me on LinkedIn for more content, discussions, or collaboration opportunities.

Thanks

Aymen

Articles: 154