CNAME vs. A Record: Understanding the Right DNS Choice
Quick Answer
A records map a hostname directly to an IPv4 address, while CNAME records create an alias to another hostname. Use an A record for direct IP mapping and a CNAME when you want a hostname to reference another domain or service. The right choice depends on your DNS setup.
The Domain Name System (DNS) is one of the fundamental systems behind the internet. Whenever someone enters a website address into a browser, DNS helps translate that human-readable hostname into information that computers can use to locate the requested service.
Two of the most commonly used DNS records are A records and CNAME records. Although both can help direct users to websites and online services, they work in different ways and are designed for different purposes.
Understanding how these records operate can help you build cleaner DNS configurations, simplify domain administration, and avoid common configuration conflicts.
Key Takeaways
- An A record connects a hostname directly to an IPv4 address.
- A CNAME record creates an alias that points one hostname to another hostname.
- A records are commonly used when a domain needs a direct IP address association.
- CNAME records are particularly useful for aliases and subdomains.
- A CNAME can make infrastructure changes easier because the alias does not need to know the destination IP address.
- A CNAME cannot normally share the same hostname with other DNS records.
- Choosing between A and CNAME depends on your domain structure, hosting environment, and management requirements.
What Is a CNAME Record?
CNAME stands for Canonical Name. Instead of assigning an IP address to a hostname, a CNAME tells DNS that one hostname should be treated as an alias for another hostname.
For example:
blog.example.com → example.com
Here, blog.example.com does not contain the server’s IP address. It refers DNS resolvers to example.com, which can then be resolved to its appropriate address.

This approach can be useful when several hostnames need to reach the same destination.
For example:
[www.example.com](https://www.example.com) → example.com
store.example.com → example.com
portal.example.com → example.com
If the destination’s IP address changes, the aliases can continue pointing toward the same canonical hostname. You generally only need to maintain the destination’s address record rather than changing every alias individually.
When Is a CNAME Useful?
CNAME records are often appropriate when:
- A subdomain needs to reference another hostname.
- Several hostnames should use the same destination.
- A third-party platform provides a hostname that your domain should point toward.
- You want DNS administration to be easier when infrastructure changes.
- You want to create an alias without hard-coding an IP address.
For troubleshooting or verification, you can inspect a hostname’s CNAME configuration with a DNS lookup utility.
What Is an A Record?
An A record, short for Address record, associates a hostname with an IPv4 address.
For example:
example.com → 192.0.2.10
When a DNS resolver receives a request for example.com, the A record supplies the IPv4 address associated with that hostname.
This makes A records a fundamental part of traditional website and server configurations.
A Record Example
Suppose a web server has the IPv4 address:
192.0.2.10
You could configure:
example.com → 192.0.2.10
A visitor can then enter the domain name rather than having to know the numerical server address.
A Records and IPv6
An important distinction is that A records are designed for IPv4 addresses.
IPv6 addresses use a different DNS record type called an AAAA record.
For example:
A → IPv4
AAAA → IPv6
Therefore, if your infrastructure supports IPv6, an A record alone may not provide the complete address configuration.
Proper DNS configuration also supports email security, as SPF, DKIM, and DMARC rely on correctly configured DNS records to help authenticate legitimate email, reduce domain spoofing, and improve protection against phishing and other email-based threats.
CNAME vs. A Record: What Is the Difference?
The simplest way to understand the difference is to look at what each record points toward.
| Feature | A Record | CNAME Record |
|---|---|---|
| Full name | Address | Canonical Name |
| Points to | IPv4 address | Another hostname |
| Typical use | Direct server mapping | Hostname alias |
| Common application | Root domains and servers | Subdomains and aliases |
| IPv4 support | Yes | Resolves through the target hostname |
| Direct IP mapping | Yes | No |
| Management flexibility | Lower when IPs change | Higher for aliases |
Consider these examples:
example.com → 192.0.2.10
blog.example.com → example.com

The first is an A record because the hostname maps directly to an IPv4 address.
The second is a CNAME because blog.example.com references another hostname.
How They Resolve Requests
With an A record, DNS can obtain the IPv4 address directly from the record:
example.com → 192.0.2.10
With a CNAME, DNS first follows the alias:
blog.example.com → example.com
The resolver then continues resolving example.com until it obtains the necessary address record.
This makes the two records fundamentally different even though both ultimately help a user reach an online service.
Common Uses for A Records
A records are frequently used when a hostname needs to map directly to a server.
Typical applications include:
- Root Domains: A domain’s primary hostname may need a direct IPv4 association
- example.com → 192.0.2.10
- Web Servers: If a website is hosted on a server with a known IPv4 address, an A record can connect the hostname to that server.
- Infrastructure With Stable IP Addresses: When the destination IP is known and relatively stable, direct address mapping can be straightforward to administer.
- Multiple Server Addresses
A hostname can have multiple A records, allowing DNS to return multiple IPv4 addresses.
For example:
example.com → 192.0.2.10
example.com → 192.0.2.11
This can be used as part of traffic distribution or redundancy strategies, depending on the infrastructure.
Common Uses for CNAME Records
CNAME records are particularly valuable when the destination is identified by a hostname rather than a fixed IP.
1. Subdomains
A common example is:
blog.example.com → example.com
2. Third-Party Services
Online platforms may provide a hostname that customers are instructed to use for a custom subdomain.
For example:
app.example.com → service.provider.example
3. Multiple Aliases
Several hostnames can reference one canonical destination:
[www.example.com](https://www.example.com) → example.com
portal.example.com → example.com
shop.example.com → example.com
This can make future infrastructure changes easier to manage.
Performance: Is A Faster Than CNAME?
There is a technical difference in the resolution path.
An A record directly provides an IPv4 address:
hostname → IPv4 address
A CNAME introduces an alias relationship:
alias → canonical hostname → IP address
Because a CNAME can require additional DNS resolution, its resolution path may involve more work than a direct A record lookup.
However, the practical impact is not necessarily significant for ordinary website visitors. DNS caching, resolver behavior, TTL values, network conditions, and other infrastructure factors can all affect actual performance.
Therefore, choosing an A record simply because it appears to have a shorter resolution path is not always the best approach. The record should match the architecture you are trying to implement.
CNAME and A Record Restrictions
One of the most important differences involves record coexistence.
A hostname configured as a CNAME generally cannot simultaneously contain another DNS record at the same name.
For example, this configuration is problematic:
blog.example.com → CNAME example.com
blog.example.com → A 192.0.2.10
A CNAME establishes an alias relationship, so the same owner name should not also carry separate records such as A, MX, or TXT records.
This restriction is important when configuring services that require multiple DNS record types.
Can You Put a CNAME on the Root Domain?
Traditional DNS rules do not allow a conventional CNAME to be used at a zone apex when that name must also carry essential records such as SOA and NS records.

For example:
example.com → CNAME another-domain.com
is generally not the standard approach for a zone’s root domain.
Some DNS providers offer proprietary or standards-based alternatives that provide CNAME-like behavior at the apex. These may be called names such as ALIAS, ANAME, or provider-specific flattening solutions.
The exact implementation depends on your DNS provider.
For conventional configurations, A or AAAA records are generally used for the apex, while CNAME records are commonly used for subdomains.
Which Should You Choose?
There is no universal winner between A and CNAME records. The correct choice depends on what you need the hostname to accomplish.
Choose an A Record If:
- You need to map a hostname directly to an IPv4 address.
- You are configuring a root domain with a specific server address.
- Your infrastructure requires direct IP mapping.
- You know the destination IPv4 address.
- You need a conventional DNS configuration for a server.
Example:
example.com → 192.0.2.10
Choose a CNAME If:
- You need an alias for another hostname.
- You are configuring a subdomain.
- A service provider gives you a hostname rather than an IP address.
- Multiple hostnames need to reference the same canonical destination.
- You want destination changes to be managed from the canonical hostname.
Example:
support.example.com → help.provider.example
A Simple Way to Remember the Difference
Think of an A record as an address and a CNAME as a name alias.
An A record essentially says:
“This hostname is available at this IPv4 address.”
A CNAME says:
“This hostname is another name for that hostname.”
That distinction makes it much easier to decide which record belongs in a particular DNS configuration.
Common CNAME and A Record Mistakes
Incorrect DNS configurations can cause websites and services to become unreachable. Some common mistakes include:
Using a CNAME and A Record at the Same Hostname
A hostname should not normally have both a CNAME and another DNS record.
Pointing a CNAME to an IP Address
A CNAME is designed to reference a hostname, not an IPv4 address.
Incorrect:
blog.example.com → 192.0.2.10
For direct IPv4 mapping, an A record is the appropriate record type.
Using an A Record When a Provider Requires a CNAME
Some hosted platforms provide a hostname specifically for customers to reference. Replacing that hostname with an IP address may not be supported or may create maintenance problems if the provider changes its infrastructure.
Forgetting IPv6
An A record handles IPv4 only. If IPv6 connectivity is required, review the corresponding AAAA record configuration as well.
Treating DNS Records as Website Redirects
A DNS record does not perform an HTTP redirect.
For example, a CNAME relationship:
blog.example.com → example.com
does not itself tell a browser which webpage URL to display. Web-server or application-level configuration controls HTTP redirects and page behavior.

Frequently Asked Questions
Can a CNAME exist without an A record?
Yes. The CNAME itself does not need to contain an IP address. It points to another hostname, and that target can ultimately resolve through an A record, AAAA record, or another appropriate DNS resolution path.
Can an A record and CNAME exist together?
They cannot normally coexist under the exact same hostname. If blog.example.com is configured as a CNAME, you should not also configure an A record for blog.example.com.
Can one domain have multiple A records?
Yes. Multiple A records can be associated with the same hostname. This can allow DNS to return multiple IPv4 addresses for a destination and may support redundancy or traffic-distribution strategies.
Is a CNAME better than an A record?
Neither record is inherently better. A records are appropriate for direct IPv4 address mapping, while CNAMEs are useful when one hostname needs to reference another hostname.
Does a CNAME point directly to an IP address?
No. A CNAME points to another hostname. DNS then resolves that target hostname to obtain the appropriate address.
Does a CNAME redirect a website?
No. DNS aliasing and HTTP redirects are different mechanisms. A CNAME changes how DNS resolves a hostname, while an HTTP redirect is handled by a web server or application.
Should I use an A record or CNAME for a subdomain?
Either may be appropriate depending on your setup. Use an A record when the subdomain needs to resolve directly to a known IPv4 address. Use a CNAME when the subdomain should act as an alias for another hostname.
Conclusion
A records and CNAME records both play important roles in DNS, but they solve different problems.
An A record creates a direct connection between a hostname and an IPv4 address, making it useful for conventional server and domain configurations. A CNAME creates an alias between hostnames, making it convenient when several names need to reference a common destination or when the destination infrastructure may change.
The best DNS configuration is not necessarily the one with fewer records or the shortest lookup path. It is the configuration that accurately reflects how your domain, hosting environment, and online services are structured.
By understanding the purpose, limitations, and practical applications of A and CNAME records, you can create DNS configurations that are easier to maintain and less likely to produce unexpected resolution problems.
General Manager
General Manager at DuoCircle. Product strategy and commercial lead across the email security portfolio.
Secure your email infrastructure
Protect, authenticate, and deliver. Contact our team to find the right solution.