Domains & DNS

DNS Records Explained: A, CNAME, MX, TXT and More

DNS records control how your domain works. Understand each record type and when to use them.

E
Editorial Team
March 15, 2026
7 min read548 views

DNS Records Overview

DNS (Domain Name System) translates domain names to IP addresses. Different record types serve different purposes.

Record Types

A Record (Address)

Points a domain to an IPv4 address:

code
yourdomain.com    A    192.168.1.100
www.yourdomain.com A   192.168.1.100

Use: Primary domain-to-server mapping.

AAAA Record

Points a domain to an IPv6 address:

code
yourdomain.com    AAAA    2001:db8::1

Use: IPv6 connectivity (increasingly important).

CNAME Record (Canonical Name)

Creates an alias for another domain:

code
www.yourdomain.com    CNAME    yourdomain.com
blog.yourdomain.com   CNAME    myapp.vercel.app

Use: Subdomains, CDN integration, platform aliases.

Warning

CNAME records cannot coexist with other records on the same name. You cannot have a CNAME at the root domain — use an A record instead.

MX Record (Mail Exchange)

Directs email to your mail server:

code
yourdomain.com    MX    10    mail.yourdomain.com
yourdomain.com    MX    20    backup-mail.yourdomain.com

Priority: Lower numbers = higher priority. Use multiple MX records for redundancy.

TXT Record

Stores text data for various purposes:

SPF (email authentication):

code
yourdomain.com TXT "v=spf1 include:_spf.google.com ~all"

DKIM (email signing):

code
selector._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=..."

DMARC (email policy):

code
_dmarc.yourdomain.com TXT "v=DMARC1; p=quarantine; rua=mailto:[email protected]"

Domain verification:

code
yourdomain.com TXT "google-site-verification=abc123"

NS Record (Name Server)

Delegates DNS for your domain:

code
yourdomain.com    NS    ns1.hosting.com
yourdomain.com    NS    ns2.hosting.com

SRV Record (Service)

Specifies server for specific services:

code
_sip._tcp.yourdomain.com SRV 10 60 5060 sip.yourdomain.com

CAA Record

Controls which CAs can issue SSL certificates:

code
yourdomain.com    CAA    0 issue "letsencrypt.org"

DNS Propagation

After changing DNS records:

  • A/AAAA/CNAME: 1-48 hours (usually under 4 hours)
  • MX records: 1-24 hours
  • Nameserver changes: 24-48 hours

Speed Up Propagation

  • Lower the TTL (Time to Live) before making changes
  • Wait for old TTL to expire
  • Use dig or online tools to verify propagation

Common Configurations

Website + Email

code
@       A       203.0.113.10          # Website
www     CNAME   @                     # www alias
@       MX  10  mail.yourdomain.com   # Email
@       TXT     "v=spf1 ..."         # Email auth

Website + Google Workspace Email

code
@       A       203.0.113.10
@       MX  1   aspmx.l.google.com
@       MX  5   alt1.aspmx.l.google.com
@       TXT     "v=spf1 include:_spf.google.com ~all"

Conclusion

Understanding DNS records gives you control over how your domain works. Most issues with websites and email can be traced back to DNS configuration. Keep this guide handy as a reference.

Share this article
E
Written by

Editorial Team

Our editorial team shares expert knowledge and practical insights to help you succeed online with hosting, domains, and web technology.

Prefer an app? Add this site to your home screen.Get the app
DNS Records Explained: A, CNAME, MX, TXT and More - Blog | DOMAIN INDIA