Skip to content
SMTPDoctor logoSMTPDoctor
← All guides

DNS RECORDS

CNAME Records Explained: How to Check and Use Them

7 min read

CNAME records are one of the most common DNS record types — and one of the most misunderstood. If you've ever pointed a subdomain at a hosting provider, set up a custom domain for a SaaS tool, or verified a service, you've used one. This guide explains what a CNAME record is, how it differs from an A record, when to use it, and how to check one.

What is a CNAME record?

A CNAME (Canonical Name) record points one hostname to another hostname, rather than to an IP address. For example, www.example.com might have a CNAME pointing to example.com. When someone looks up the alias, DNS follows the CNAME to the target name, then resolves that target's IP address. In effect, the CNAME says "this name is really just another name for that one."

CNAME vs A record: what's the difference?

The two are easy to confuse, but the distinction is simple:

  • An A record points a hostname directly to an IP address (e.g. 93.184.216.34).
  • A CNAME record points a hostname to another hostname, which is then resolved onward to an IP.

Use an A record when you have a specific IP to point at. Use a CNAME when you want an alias that automatically follows another name — so if that target's IP changes, you don't have to update anything.

When to use a CNAME

CNAMEs shine whenever you want a name to track another name:

  • Pointing www to your root domain (or vice versa).
  • Connecting a subdomain to a third-party service — a SaaS app, a CDN, a help desk, an email platform — where the provider gives you a hostname to point to rather than an IP.
  • Domain verification, where a service asks you to add a CNAME to prove you control the domain.

The one big limitation: the root domain

You generally cannot put a CNAME on the root domain (the zone apex, like example.comwith nothing in front). The DNS spec forbids it because a CNAME can't coexist with the required NS and SOA records that live at the root. Most DNS providers offer a workaround — CNAME flattening or ALIAS/ANAME records — that gives you the same behavior at the root without breaking the rules.

How to check a CNAME record

To see where a hostname points, run it through a CNAME checker. It queries DNS and returns the target the CNAME resolves to. This is useful for confirming an alias is set up correctly, seeing where a subdomain actually points, and catching dangling CNAMEs that could enable subdomain takeover. After changing a CNAME, it's also worth confirming it has propagated with a DNS propagation check.

Look up a CNAME record now

Check where any hostname's CNAME points, free and instantly — no signup required.

Open the tool →

Frequently asked questions

What is a CNAME record?

A DNS record that points one hostname to another hostname instead of an IP address. Resolvers follow the CNAME to its target, then resolve that target's address.

What's the difference between a CNAME and an A record?

An A record points to an IP address; a CNAME points to another hostname. Use an A record when you have an IP, and a CNAME when you want an alias that follows another name.

Can the root domain have a CNAME?

Traditionally no — the DNS spec forbids a CNAME at the zone apex. Many providers offer CNAME flattening or ALIAS/ANAME records as a workaround.