Ctrl + K
Network9 min read

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

Understand the most common DNS record types and when to use them.

Published: 2026-06-22

Every website, email service and online application depends on the Domain Name System, commonly known as DNS. DNS acts as the internet's phone book, translating human-friendly domain names into IP addresses that computers can understand. Without DNS, users would need to remember long strings of numbers instead of simple domain names like example.com.

DNS works through different types of records. Each record has a specific purpose, such as pointing a domain to a web server, directing email traffic or storing verification information. Understanding the most common DNS records is an essential skill for developers, system administrators and website owners.

What Is a DNS Record?

A DNS record is a configuration entry stored within a domain's DNS zone. These records tell DNS servers how requests for a domain should be handled.

When a user visits a website or sends an email, DNS records provide the information needed to locate the correct server.

Different record types serve different purposes. Some point to servers, some define aliases and others store metadata used by external services.

A Record

The A record is one of the most important DNS record types. It maps a domain name directly to an IPv4 address.

When someone visits a website, DNS often uses an A record to determine which server hosts the site.

example.com.    IN    A    192.0.2.10

In this example, example.com points to the IPv4 address 192.0.2.10.

If your website runs on a traditional web server with a public IPv4 address, you will almost certainly use an A record.

AAAA Record

The AAAA record performs the same function as an A record but uses IPv6 instead of IPv4.

As IPv6 adoption increases, more websites and services are adding AAAA records alongside traditional A records.

example.com.    IN    AAAA    2001:db8::1

This record points the domain to an IPv6 address.

Many modern hosting providers support both IPv4 and IPv6 simultaneously, allowing websites to remain accessible regardless of the visitor's network configuration.

MX Record

MX stands for Mail Exchange. MX records tell email systems where messages for a domain should be delivered.

Without MX records, email services would not know which server is responsible for receiving mail.

example.com.    IN    MX    10 mail.example.com.

The number 10 represents the priority value. Lower numbers indicate higher priority.

Domains often have multiple MX records with different priorities so that backup mail servers can receive messages if the primary server becomes unavailable.

TXT Record

TXT records store arbitrary text data inside DNS. Originally intended for human-readable notes, TXT records are now widely used for service verification and email security.

Many platforms ask users to add TXT records to prove domain ownership.

example.com.    IN    TXT    "google-site-verification=abc123"

TXT records are also commonly used for SPF, DKIM and DMARC email authentication systems.

Because TXT records are flexible, they have become one of the most heavily used DNS record types.

CNAME Record

CNAME stands for Canonical Name. A CNAME record creates an alias that points one hostname to another hostname.

Instead of pointing directly to an IP address, the DNS resolver follows the alias and looks up the target hostname.

www.example.com.    IN    CNAME    example.com.

In this example, requests for www.example.com are redirected to example.com.

CNAME records are commonly used when connecting custom domains to cloud platforms, CDNs and third-party services.

How DNS Resolution Works

When a user enters a domain into a browser, several DNS queries may occur behind the scenes.

The resolver first checks its cache. If no cached record exists, it contacts authoritative DNS servers to retrieve the necessary information.

If a CNAME record is encountered, an additional lookup occurs for the target hostname. Eventually the resolver obtains an A or AAAA record containing the server's IP address.

The browser can then establish a connection to the correct server.

Common Real-World Examples

A typical website may use an A record for the root domain and a CNAME record for the www subdomain.

example.com.        IN A      192.0.2.10
www.example.com.    IN CNAME  example.com.

Email services such as Google Workspace or Microsoft 365 usually require several MX records plus TXT records for verification and spam protection.

Cloud services often use CNAME records because their infrastructure can change over time without requiring customers to update IP addresses manually.

TTL and DNS Propagation

Every DNS record has a TTL value, which stands for Time To Live. TTL determines how long DNS resolvers can cache a record before requesting an updated version.

A shorter TTL allows changes to propagate more quickly but increases DNS traffic. A longer TTL reduces lookup frequency but may delay updates.

When administrators modify DNS records, changes are not always visible immediately because cached data may still exist across DNS servers worldwide.

Common DNS Mistakes

One common mistake is creating conflicting records. For example, a hostname generally cannot have both a CNAME record and other record types at the same level.

Another frequent issue involves incorrect MX priorities, which can cause email delivery problems.

Misconfigured TXT records are also common, especially when setting up SPF, DKIM or domain verification services.

Which DNS Record Should You Use?

Use an A record when pointing a hostname directly to an IPv4 address.

Use an AAAA record when pointing a hostname to an IPv6 address.

Use an MX record when configuring email delivery.

Use a TXT record when storing verification or authentication information.

Use a CNAME record when creating aliases for existing hostnames.

Conclusion

DNS records are the foundation of how domains interact with websites, email systems and online services. The A and AAAA records connect domains to servers, MX records handle email routing, TXT records provide verification and metadata, and CNAME records create aliases that simplify infrastructure management. Understanding these record types makes it much easier to configure domains, troubleshoot DNS issues and manage modern web applications effectively.

Related Tools