Common DNS Record Types Explained: A, CNAME, MX, and TXT

A clear breakdown of the four DNS record types you will use most often when managing a domain and its email.

· Updated · 3,924 views

DNS records are the individual instructions inside a domain's zone file. Most everyday tasks involve just four record types. Knowing what each one does makes it easy to point a site, configure email, or verify ownership.

The Four Core Record Types

| Record | Purpose | Example value | | ------ | ------- | ------------- | | A | Maps a name to an IPv4 address | 192.0.2.10 | | CNAME | Aliases one name to another name | shop.nairohost.site | | MX | Directs email to a mail server | mail.nairohost.site | | TXT | Stores text data for verification | v=spf1 include:_spf... |

When to Use Each

  • A record: use it to point a domain or subdomain directly at a server IP address.
  • CNAME record: use it when a name should follow another name, for example pointing www to your root domain.
  • MX record: use it to tell the world which server receives email for your domain. MX records include a priority number where lower values are tried first.
  • TXT record: use it for SPF, DKIM, DMARC, and one-off verification strings from services like Google or Facebook.

A Few Practical Notes

A CNAME cannot coexist with other records on the same name, so never put a CNAME on your root domain. Use an A record there instead. There is also an AAAA record, which works like an A record but for IPv6 addresses.

All of these records can be created and edited in the cPanel Zone Editor under your hosting account. Each change takes effect after propagation, so allow some time before testing.

Was this article helpful?

Your feedback helps us improve our documentation.

Still Need Help?

Our support team is available 24/7 to assist you.