DNS Record Types Explained: A, AAAA, MX, CNAME, TXT

by Tommy N. Updated Apr 23, 2026

Every time you type a web address, send an email, or connect to an online service, DNS record types are working behind the scenes to route your request to the right destination. Understanding DNS record types — A, AAAA, MX, CNAME, and TXT — gives you real control over how your domain behaves on the internet and helps you diagnose connectivity problems fast.

Diagram showing DNS record types A, AAAA, MX, CNAME, and TXT with their functions illustrated
Figure 1 — DNS Record Types Explained: A, AAAA, MX, CNAME, TXT

In this guide you will learn exactly what each DNS record type does, when to use it, and how to read or update your own records. Whether you are setting up a new domain, troubleshooting email delivery, or simply trying to understand how the internet works, knowing your DNS records is a foundational skill — just like knowing what an IP address is or understanding how to change DNS on your router.

DNS Record Types Explained: A, AAAA, MX, CNAME, TXT — complete visual guide showing record formats and use cases
Figure 2 — DNS Record Types Explained: A, AAAA, MX, CNAME, TXT at a Glance

What Is DNS and Why Do Record Types Matter?

DNS stands for Domain Name System, and it functions as the phone book of the internet. When you type example.com into a browser, your computer queries a DNS server to find the numeric IP address that corresponds to that name. Without DNS, every user would need to memorize strings of numbers instead of human-friendly domain names. DNS records are the individual entries in that phone book, and each type serves a distinct purpose.

A DNS zone file is a collection of these records, all tied to a specific domain. Each record contains at least three pieces of information: the name (which subdomain or root domain it applies to), the type (A, AAAA, MX, and so on), and the value (the data the record points to). There is also a TTL, or Time To Live, measured in seconds, which tells resolvers how long to cache the record before asking for a fresh copy.

When you make a change to a DNS record — say, pointing your domain to a new server — the change does not take effect instantly everywhere. Resolvers around the world cache the old value until the TTL expires. This propagation delay can range from a few minutes to 48 hours, depending on how the TTL was set before the change. Lowering your TTL to 300 seconds (5 minutes) before making planned changes is standard practice for minimizing downtime.

Each record type was designed by the IETF to solve a specific routing or verification problem. Using the wrong record type for a job — for example, pointing an email server with a CNAME instead of an MX record — can cause silent failures that are surprisingly hard to debug. Understanding what each type is designed for eliminates an entire class of configuration mistakes.

The Five Essential DNS Record Types and How to Read Them

Here is a practical walkthrough of the five most important DNS record types, what they look like, and when you will encounter them.

  1. A Record (Address Record) — The A record maps a hostname to an IPv4 address. For example, example.com. 3600 IN A 93.184.216.34 tells resolvers that example.com lives at that specific IPv4 address. This is the most common record type and the one most web servers rely on to receive incoming traffic.
  2. AAAA Record (IPv6 Address Record) — The AAAA record does exactly what the A record does, but for IPv6 addresses. An example entry looks like example.com. 3600 IN AAAA 2606:2800:220:1:248:1893:25c8:1946. As IPv4 addresses become scarce, AAAA records are increasingly important; modern operating systems will prefer an AAAA record over an A record when both exist.
  3. MX Record (Mail Exchange Record) — MX records direct email for a domain to the correct mail servers. They include a priority value, so example.com. 3600 IN MX 10 mail.example.com. means: send email for this domain to mail.example.com with a priority of 10. Lower numbers mean higher priority, which is how you set up primary and backup mail servers.
  4. CNAME Record (Canonical Name Record) — A CNAME creates an alias from one hostname to another. For instance, www.example.com. 3600 IN CNAME example.com. makes www.example.com resolve to whatever example.com currently points to. CNAMEs are convenient for subdomains but cannot be used at the root (apex) of a domain alongside other records.
  5. TXT Record (Text Record) — TXT records store arbitrary text strings associated with a domain. They are most commonly used for domain ownership verification (Google Search Console, for example) and email authentication standards such as SPF, DKIM, and DMARC. An SPF record looks like example.com. 3600 IN TXT "v=spf1 include:_spf.google.com ~all".

DNS Record Types Compared: Quick Reference

The table below summarizes the key differences between the five DNS record types so you can choose the right one at a glance.

Record TypePurposeValue FormatTypical TTL
AMaps hostname to IPv4 addressxxx.xxx.xxx.xxx (e.g., 93.184.216.34)3600 s
AAAAMaps hostname to IPv6 addressEight groups of hex digits (e.g., 2606:2800::1)3600 s
MXRoutes email to mail serversPriority + mail server hostname3600 s
CNAMEAlias from one hostname to anotherFully qualified domain name1800 s
TXTStores text for verification & email authQuoted string (up to 255 chars per string)3600 s

Tip: Check Your Records Before You Change Them

Before editing any DNS record, use our free DNS Lookup tool to see the current live values for your domain. This gives you a baseline to compare against after your changes propagate and helps you catch typos or misconfigurations immediately.

Troubleshooting DNS Record Problems and Best Practices

Even a small mistake in a DNS record — a missing trailing dot, an extra space, or the wrong record type — can take your website offline or break email delivery for your entire domain. The good news is that most DNS problems follow predictable patterns and can be resolved systematically.

Email failures are often traced to misconfigured MX or TXT records. If your outgoing email is landing in spam or being rejected outright, check that your SPF, DKIM, and DMARC TXT records are present and correctly formatted. SPF records must not have more than ten DNS lookups (the include mechanism counts), and you should have only one SPF record per domain — multiple SPF TXT records cause evaluation failures. You can verify your domain's current DNS state any time with the DNS Lookup tool.

Website downtime after a migration is almost always a DNS propagation issue. If your site loads on some networks but not others, the old cached A or AAAA record is still being served by certain resolvers. Using a low TTL (300 seconds) before migrating — and waiting at least that long after the migration — minimizes the window of inconsistency. After propagation completes, raise your TTL back to 3600 seconds or higher to reduce query load on your nameservers.

  • Never point an MX record to a CNAME — RFC 2181 prohibits it and many mail servers will silently refuse delivery
  • Do not use a CNAME at the domain apex (root domain); use an A or AAAA record there instead, or an ALIAS/ANAME record if your DNS provider supports it
  • Always end fully qualified domain names in DNS zone files with a trailing dot (e.g., mail.example.com.) to prevent the zone name from being appended automatically
  • After adding AAAA records, test IPv6 reachability separately — some hosting providers do not enable IPv6 routing by default even if the record exists

Pro Tip: Run a DNS lookup on your own domain regularly — especially after your DNS provider performs maintenance — using our DNS Lookup tool. Unexpected record changes or TTL resets are occasionally introduced by provider-side migrations and are easy to miss until something breaks.

Common DNS Mistakes That Break Domains

  • Deleting an A record before confirming the new one has fully propagated, causing a downtime window
  • Setting TTL to 86400 (24 hours) right before a planned migration, meaning the old record will be cached for a full day
  • Adding a second SPF TXT record instead of updating the existing one, which invalidates both records
  • Forgetting to add both an A and an AAAA record for dual-stack hosts, leaving IPv6-only users unable to reach the site

Frequently Asked Questions

What is the difference between an A record and a CNAME record?

An A record maps a hostname directly to an IPv4 address, while a CNAME record creates an alias that points to another hostname, which is then resolved to an IP. A records are faster since they require one fewer DNS lookup, and they are the only option at the domain apex (root domain). CNAMEs are best used for subdomains like www or blog where you want them to automatically follow changes to the target hostname.

Can I have both an A record and an AAAA record for the same hostname?

Yes, and for most modern websites you should. Having both records enables dual-stack connectivity: IPv6-capable clients will use the AAAA record, while older clients fall back to the A record automatically. This is handled transparently by the operating system through a mechanism called Happy Eyeballs. You can verify both records exist for your domain using our DNS Lookup tool.

Why do I need a TXT record for email, and what is SPF?

Sender Policy Framework (SPF) is an email authentication standard stored as a TXT record that lists which mail servers are authorized to send email on behalf of your domain. When a receiving mail server gets a message claiming to be from your domain, it checks the SPF TXT record to verify the sending server is on the approved list. Without SPF, anyone can spoof your domain in email headers, and many servers will treat your legitimate messages as spam.

How long does it take for DNS changes to propagate?

DNS propagation time depends on the TTL value set on the record before the change. If the TTL was 3600 seconds (1 hour), resolvers that cached the old value can take up to an hour to see the update. Global propagation across all resolvers can take up to 48 hours in rare cases, though most changes are visible within a few hours. Lowering your TTL to 300 seconds at least 24 hours before a planned change dramatically reduces this window.

What does the priority number in an MX record mean?

The priority (or preference) value in an MX record tells sending mail servers which mail exchanger to try first. Lower numbers have higher priority, so a server with priority 10 will be tried before one with priority 20. If the primary mail server (priority 10) is unreachable, the sending server will fall back to the next lowest priority. Most small domains only need one MX record, but adding a backup with a higher priority number provides resilience.

Why can't I use a CNAME record at the root of my domain?

RFC 1912 and RFC 2181 prohibit a CNAME record from sharing a name with any other record type. At the domain apex (e.g., example.com without a subdomain), you must have SOA and NS records, which means a CNAME there would conflict. Some DNS providers offer a proprietary ALIAS or ANAME record type that behaves like a CNAME but resolves transparently at the apex; this is not a standard DNS record type, so availability varies by provider.

Key Takeaways

  • A records map hostnames to IPv4 addresses; AAAA records do the same for IPv6 — use both for dual-stack hosting
  • MX records route incoming email and support failover via priority values; never point them to CNAMEs
  • CNAME records create hostname aliases and are best used for subdomains, not the domain apex
  • TXT records carry plain-text data used for domain verification, SPF, DKIM, and DMARC email authentication
  • Lower your TTL to 300 seconds at least 24 hours before any planned DNS change to minimize propagation delays

Related Guides

For authoritative networking standards and specifications, refer to the Internet Assigned Numbers Authority (IANA) or IETF RFC documents.

Tommy N.

About Tommy N.

Tommy is the founder of RouterHax and a network engineer with over ten years of experience in home and enterprise networking. He has configured and troubleshot networks ranging from simple home setups to multi-site enterprise deployments, with deep hands-on experience in router configuration, WiFi optimization, and network security. At RouterHax, he oversees editorial direction and covers home networking guides, mesh WiFi system reviews, and practical troubleshooting resources for everyday users.

Promotion for FREE Gifts. Moreover, Free Items here. Disable Ad Blocker to get them all.

Once done, hit any button as below