CNAME Records Print

  • dnsnameservers, domain, dns, subdomain, cloudflare, errors, guide, howto
  • 0

Pointing a name at another name.

WHAT IT DOES

Makes one name an alias for another. Queries for the alias return whatever the target resolves to.

TYPICAL USE

www as a CNAME to the bare domain, so changing the address requires updating only one record.

Third-party services asking you to point a subdomain at their hostname.

THE RESTRICTION THAT CATCHES PEOPLE

A CNAME cannot coexist with any other record for the same name.

You cannot have a CNAME and an MX record on the same name. You cannot have a CNAME on the bare domain where SOA and NS records must exist.

WHY THE BARE DOMAIN MATTERS

Standard DNS forbids a CNAME at the root. Some providers offer a workaround, variously called ALIAS or CNAME flattening, which resolves the target and returns an address instead.

Cloudflare supports this; most providers do not.

WHEN TO USE ONE

When the target's address may change and you want to follow it automatically.

WHEN NOT TO

On the bare domain, unless your provider supports flattening Where other records exist for the same name

THE COMMON ERROR

Adding a CNAME for a name that already has an A record. Remove the A record first.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot