If you've ever set up a domain and hit the choice between an A record and a CNAME, you've probably wondered what the difference actually is — and which one you're supposed to use. They both point a name somewhere, but they work in fundamentally different ways, and picking the wrong one can break your site or email. Here's a clear, plain-English breakdown of A record vs CNAME, when to use each, and the gotchas that trip people up.

What is an A record?

An A record maps a domain name directly to an IP address — the numeric location of a server, like 93.184.216.34. It's the most fundamental DNS record: it answers "what's the actual address for this name?" in one step. (An AAAA record does the same thing for IPv6 addresses.)

When you point example.com at your web server's IP, you're using an A record. If you want to see a domain's A record, you can look it up with our free DNS Records tool — it's also how you find a website's IP address.

What is a CNAME record?

A CNAME (Canonical Name) record maps a domain name to another name, not to an IP address. It's an alias. Instead of saying "this name lives at this IP," it says "this name is really just another name for that name — go look that one up instead."

For example, you might point www.example.com via a CNAME to example.com, or point shop.example.com to a hosted store provider's address like stores.shopify.com. The browser then resolves that target name to find the final IP. In effect, a CNAME adds a step: resolve the alias, then resolve what it points to.

A record vs CNAME: the key differences

Here's what actually separates them:

  • What they point to. An A record points to an IP address; a CNAME points to another hostname.
  • Number of lookups. An A record resolves in one step. A CNAME needs an extra lookup (the alias, then its target), which adds a tiny bit of latency.
  • Following changes automatically. This is the big one. If the target's IP address changes, a CNAME follows it automatically — you never touch your record. With an A record, if the server's IP changes, you must update it manually.
  • Where they can live. An A record can sit on your root domain (example.com). A CNAME cannot be used on the root/apex domain — only on subdomains (more on this below).
  • Coexisting with other records. A name using a CNAME can't have any other records (like MX or TXT) at the same time. An A record has no such restriction.

When to use an A record

Reach for an A record when:

  • You're pointing your root domain (example.com) at a server — a CNAME isn't allowed there.
  • You have a stable IP address you control, such as your own server or VPS.
  • You need other records at the same name, like MX records for email or TXT records for SPF, DKIM and DMARC — these require the name to not be a CNAME.

In short: A records are ideal for your apex domain and for anything pointing at a fixed IP you manage.

When to use a CNAME

Reach for a CNAME when:

  • You're pointing a subdomain at a third-party servicewww to a CDN, blog to a hosted platform, shop to an e-commerce provider — where that provider manages the underlying IP.
  • You want the record to auto-follow the target's IP changes, so you never have to update it when the provider moves servers.
  • You're setting up services (like many SaaS tools) that specifically instruct you to "add a CNAME pointing to our hostname."

The auto-following behavior is the main reason CNAMEs exist: they let a big provider change their infrastructure freely without every customer having to update DNS.

Common CNAME gotchas

CNAMEs cause more confusion than any other record type, so watch for these:

  • No CNAME at the root/apex. You can't put a CNAME on example.com itself — only on subdomains like www.example.com. Many DNS providers offer a workaround called CNAME flattening, ALIAS, or ANAME that mimics CNAME behavior at the root while technically serving an A record.
  • A CNAME can't coexist with other records. If a name is a CNAME, it can't also have MX, TXT, or other records. This is exactly why an MX record must never point to a CNAME.
  • Extra latency. Because a CNAME requires resolving a second name, it adds a small delay. Long CNAME chains (aliases pointing to aliases) compound this — keep them short.

The bottom line

The difference comes down to this: an A record points a name to an IP address, while a CNAME points a name to another name and follows it automatically. Use an A record for your root domain and anything on a fixed IP you control; use a CNAME for subdomains pointing to third-party services whose IPs you'd rather not track. Remember that CNAMEs can't live at the apex and can't share a name with other records — and when in doubt, look up what's currently set with a free DNS Records tool before you change anything.