EBH DNSCHECK
Your IP:
en

A Record vs CNAME Record: Differences, Examples and When to Use Each

August 2, 2026
A Record and CNAME Record comparison connecting domain names to IP addresses and canonical hostnames

A Record vs CNAME Record: Differences, Examples and When to Use Each

A records and CNAME records both direct users toward online services, but they store different types of targets. Choosing the wrong record can create routing problems, invalid DNS configurations, or difficult migrations.

An A record points directly to an IPv4 address. A CNAME record makes one hostname an alias of another hostname.

What Is an A Record?

An A record maps a hostname directly to an IPv4 address.

example.com → 192.0.2.10

It is commonly used for root domains, web servers, application servers, APIs, VPN gateways, and other services with a known IPv4 address.

What Is a CNAME Record?

A CNAME maps one hostname to another hostname.

www.example.com → example.com

The resolver then follows the target hostname to obtain its A or AAAA records. CNAME records are common for CDNs, SaaS platforms, cloud services, hosted applications, and subdomains.

A Record vs CNAME Record

FeatureA RecordCNAME Record
TargetIPv4 addressAnother hostname
Typical useDirect server addressAlias to a provider hostname
Additional lookupUsually noUsually yes
Root domainCommonly supportedTraditionally problematic
Follows target IP changesNoYes

When to Use an A Record

Use an A record when the destination provides a fixed IPv4 address and you want direct resolution.

app.example.com → 203.0.113.25
  • You manage the destination IP
  • The hosting provider supplies a fixed IPv4 address
  • You are configuring the root domain
  • You require direct resolution to an IPv4 endpoint

When to Use a CNAME Record

Use a CNAME when the service provider supplies a hostname rather than an IP address.

store.example.com → customer.hosted-platform.example

This allows the provider to change underlying IP addresses without requiring you to modify your DNS record.

Can a CNAME Share Its Name with Other Records?

A hostname configured as a CNAME should not normally have A, MX, TXT, or other records at the same name.

portal.example.com CNAME target.example.net
portal.example.com A 192.0.2.10

This conflicting configuration should be avoided.

Can a CNAME Be Used at the Root Domain?

The zone apex must contain SOA and NS records, which conflicts with traditional CNAME behavior. Some DNS providers offer ALIAS, ANAME, or CNAME-flattening features that simulate CNAME-style behavior at the root.

Check the provider documentation rather than assuming a normal CNAME is supported.

How to Check A and CNAME Records

nslookup example.com
dig A example.com
dig CNAME www.example.com

Always query the exact hostname. Checking example.com does not automatically verify www.example.com.

Common Problems

  • A record points to an old server
  • CNAME target contains a typo
  • An obsolete AAAA record sends IPv6 users elsewhere
  • Root and www point to different platforms
  • The CNAME is created at the wrong hostname
  • A CDN proxy hides the origin address
  • Conflicting records exist at the same name

Frequently Asked Questions

Is a CNAME an HTTP redirect?

No. It is a DNS alias and does not change the URL shown in the browser.

Can a CNAME point to an IP address?

No. The CNAME target must be another hostname.

Which is faster, A or CNAME?

An A record resolves directly, while a CNAME can require another lookup. DNS caching usually makes the practical difference small.

Can I replace every A record with a CNAME?

No. The correct choice depends on the hostname, provider requirements, and zone-apex limitations.

Conclusion

Use an A record for a direct IPv4 destination and a CNAME for an alias to another hostname.

Use the DNSCheckers.com DNS Lookup Tool to verify both record types.