# CNAME record

> A CNAME record is a DNS entry that makes one hostname an alias for another, so that app.example.com resolves to whatever your hosting provider's address…

Source: https://northerngo.com/glossary/cname-record/
Language: en
Updated: 2026-08-28

---
**A CNAME record is a DNS entry that makes one hostname an alias for another, so that app.example.com resolves to whatever your hosting provider's address currently resolves to. It points at a name rather than an IP address, which is why the provider can change servers without you touching your DNS.**

### What it does and why you would use one

An A record maps a name directly to an IP address. A CNAME maps a name to another name, and the resolver then looks that name up in turn. When you point `app.example.com` at `myapp.web.app` with a CNAME, the hosting provider can move between IP addresses, add edge locations or fail over to another region, and your domain follows automatically.

That indirection is the whole value. It is also why almost every managed host — Firebase, Netlify, Vercel, Cloudflare Pages — asks for a CNAME rather than giving you an IP address.

CNAMEs also show up as proof of ownership: providers frequently ask you to create a record such as `_acme-challenge.example.com` before issuing an [SSL certificate](/glossary/ssl-certificate/), because only someone who controls the domain can create it.

### The misconception that costs the most time

**A CNAME cannot be set on a bare apex domain at most registrars.** `example.com` with no prefix must carry its NS and SOA records, and the DNS specification does not allow a CNAME to coexist with other records at the same name. So `www.example.com` can be a CNAME, and `example.com` cannot.

The workarounds, in the order you should try them:

1. **Use your DNS provider's flattened alias.** Cloudflare calls it CNAME flattening, Route 53 calls it an ALIAS record, others call it ANAME. It behaves like a CNAME at the apex and resolves to an address before answering.
2. **Use an A record with the IP addresses your host publishes.** This works everywhere but breaks silently if the host ever changes them.
3. **Redirect the apex to `www`** and keep the CNAME on `www`.

### Other things worth knowing

Changes are not instant — the old record stays cached for the length of its TTL, so lowering the TTL a day before a migration saves a lot of waiting. Trailing dots matter in some control panels: `myapp.web.app` and `myapp.web.app.` are not the same to every provider. And you cannot have both a CNAME and an MX or TXT record on the same name, which is a common reason mail suddenly stops arriving. [Connecting a custom domain](/resources/connect-custom-domain-ssl/) walks through the practical sequence.

---

NorthernGo is an AI-powered platform for building production-ready web apps with zero coding. Local AI generation via WebGPU is unlimited and free, and you own all generated source code. https://northerngo.com/
