Bridge CDN
On this page

What is a CNAME record?

CNAME stands for canonical name. The record says "this name is just another label for that one, go ask about that one instead." The alias holds no address of its own. Whatever the target resolves to, the alias resolves to as well.

That's the whole appeal. If www, blog and shop all follow one target, you change one address and every alias follows.

Quick facts
RR type number 5
Defined in RFC 1035; usage rules in RFC 1034 §3.6.2 and RFC 2181 §10.1
Holds One target hostname, never an IP address
Allowed at the zone apex No
Can share its name with other records No (DNSSEC records excepted)
Auto TTL in Bridge DNS 60 seconds
Proxy switch in Bridge No, the proxy is for A and AAAA only

CNAME record syntax

In zone-file notation, a CNAME looks like this:

www.example.com.   60   IN   CNAME   example.com.
shop               60   IN   CNAME   stores.example.net.

Field by field:

  • Owner name. The alias, here www.example.com. or the relative label shop.
  • TTL. How long resolvers may cache the alias, in seconds.
  • Class. Always IN for internet DNS.
  • Type. CNAME.
  • Target. The canonical hostname the alias points to.

Watch the trailing dot. In a zone file, example.com. is a full name. example.com without the dot gets the zone appended, so it turns into example.com.example.com. The Bridge editor handles this for you, but it's the first thing to check in an exported file.

CNAME record example: www and subdomains

The most common CNAME record example is www. The apex carries the A record, and www points at the apex:

@     60   IN   A       203.0.113.10
www   60   IN   CNAME   example.com.

Move the server, update the one A record, and www follows automatically.

Subdomains for hosted services work the same way. A help desk, a status page or an online store usually gives you a hostname like stores.example.net. You create shop.example.com as a CNAME to it, and the provider can change its own IPs without asking you.

You'll also meet CNAMEs that nobody visits in a browser. Email platforms publish DKIM keys behind CNAMEs like sel1._domainkey, and certificate services ask for validation CNAMEs. They follow the same rules.

How to add a CNAME in Bridge DNS

  1. Open the zone and choose Add record.
  2. Pick CNAME as the type.
  3. Enter the alias: www, shop, or a longer label like sel1._domainkey.
  4. Enter the target hostname exactly as your provider gave it. Never an IP address.
  5. Keep TTL on Auto (60 seconds) unless you need longer caching.
  6. Save. Our nameservers serve the new alias within seconds.

To use the per-record Bridge proxy switch for www, give it an A or AAAA record.

How to check a CNAME

Ask for the CNAME itself:

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

Then ask for an address. A resolver follows the alias and returns both steps:

dig www.example.com A
;; ANSWER SECTION:
www.example.com.   60   IN   CNAME   example.com.
example.com.       60   IN   A       203.0.113.10

To check what Bridge serves before resolvers catch up, add @ns1.bb-ns.com to either command.

Why can't the root domain use a CNAME?

The root of a zone, example.com itself, always carries an SOA record and NS records. A CNAME is not allowed to share its name with any other record (RFC 1034 §3.6.2, RFC 2181 §10.1). So a CNAME at the apex would break the zone, and standards-compliant DNS software refuses it.

This bites when a hosting platform says "point your domain at app.example.net with a CNAME." For www that works. For the bare domain, you have three options:

  • A or AAAA records at the apex. Use the IP addresses the platform publishes for root domains. Most platforms list them.
  • A proxied A record in Bridge. If the platform supplies an origin IP, a proxied A record lets the apex resolve to the Bridge edge.
  • Flattening at the DNS host. Some providers offer CNAME flattening or an ALIAS record. They resolve the target themselves and publish plain addresses at the apex.

To fix a root-domain CNAME you inherited from an old provider, replace it with A/AAAA records or a proxied A record. Then keep www as a CNAME to the apex.

How to fix a CNAME conflict

A CNAME conflict happens when you try to put an alias on a name that already has another record. The editor will refuse it, and so will any standards-compliant DNS host.

The usual culprits:

  • a TXT verification string on shop when you add shop as a CNAME;
  • an MX record on a subdomain that you now want to alias;
  • an old A record on www that nobody removed.

The fix depends on which record matters more. If the alias is the point, move the other record or delete it. If the TXT has to live on that exact name, use an A record instead of a CNAME there.

CNAME chains and loops

A CNAME chain is an alias pointing at another alias. shop → stores.example.net → edge.example.org is legal, and resolvers follow it. Each hop is one more lookup, though, and each hop has its own TTL and its own owner. Keep your own chains to one hop and let the provider manage theirs.

A loop is a chain that comes back to itself: a → b → a. Resolvers give up and return SERVFAIL. Loops usually appear when two people edit the same zone, or when two aliases are swapped during a migration. dig +trace shows the repeating names.

Common mistakes

  • Pointing a CNAME at an IP address. The target must be a hostname.
  • Pointing an MX record at a CNAME. MX targets must be names with their own A or AAAA records (RFC 2181 §10.3).
  • Missing trailing dot in an imported zone file, which creates www.example.com.example.com.
  • Leaving an old record on the same name, which blocks the new alias.
  • Putting a CNAME on the bare domain because a platform's setup page assumed www.

Alias or address: when to pick each

Use an alias when the name should follow someone else's hostname: SaaS platforms, CDNs, verification targets, or www following your apex. Use an A or AAAA record when you control the IP address, when the name is the zone apex, or when you need the Bridge proxy on that name.

For address records at the apex, see the A record reference. For every record type Bridge supports, go back to DNS record types and setup.

CNAME record questions

What is a CNAME record in DNS?

A CNAME record is a DNS entry that makes one hostname an alias of another. Resolvers that find it repeat the lookup at the target and return the target's addresses. It's defined in RFC 1035 as type 5.

What does a CNAME record do?

It sends lookups for one name to another name. That lets many aliases follow a single target, so a change to the target's addresses applies to every alias at once.

How do I create a CNAME record?

In Bridge DNS, open the zone, add a record, choose CNAME, enter the alias and the target hostname, and save. The alias must not have any other records on the same name.

Can a CNAME point to an IP address?

No. A CNAME target must be a hostname. To point a name at an IP address, use an A record for IPv4 or an AAAA record for IPv6.

Can I use a CNAME on my root domain?

No. The root domain already has SOA and NS records, and a CNAME can't share its name with other records. Use A or AAAA records, or a proxied A record in Bridge.

What is CNAME flattening?

CNAME flattening is a DNS host feature that resolves a CNAME-style target on the server side and publishes the resulting addresses as ordinary records. Some providers use it to allow apex aliases.

How do I check the CNAME records for a domain?

Run dig www.example.com CNAME +short for one name, or nslookup -type=CNAME www.example.com on Windows. A zone's full list of aliases is visible only in the DNS host's dashboard.