DNS A Record vs CNAME Record — What's the Difference?

An A record points a domain name directly to an IPv4 address; a CNAME record points a domain name to another domain name, which is then resolved separately.

Published October 4, 2026

An A record maps a hostname directly to an IPv4 address; a CNAME maps a hostname to another hostname (an alias). Use CNAME for subdomains that should follow another name, and A for the root domain.

The concept

With an A record, www.example.com → 203.0.113.42. With a CNAME, www.example.com → example.com, and resolvers then look up that name's A record.

A CNAME cannot coexist with other records on the same name and is not allowed at the zone apex (example.com itself); some providers offer ALIAS/ANAME for that.

Resolution chain

alias ofresolves toblog.example.comCNAMEhost.provider.netA record203.0.113.9IP
A CNAME adds one more lookup.

Practical examples

Zone file

example.com.      A      203.0.113.42
www               CNAME  example.com.
blog              CNAME  mysite.hosting.net.

Query it

dig +short www.example.com CNAME
dig +short example.com A

Point to a SaaS (shop, docs)

shop.example.com CNAME shops.myshopify.com.

Common mistakes

  • Adding a CNAME at the root domain.
  • Putting an MX record on a name that has a CNAME.
  • Forgetting the trailing dot in zone files.
  • Expecting changes immediately — TTL delays propagation.

Key takeaways

  • A = name → IP, CNAME = name → name.
  • No CNAME at the apex.
  • Mind TTLs.

FAQ

What is AAAA?

An A record for IPv6.

Why is my DNS change not live?

Resolvers cache records until the TTL expires.

More General articles