Nodea — logo

CNAME record

A CNAME record (Canonical Name) is a DNS entry that creates an alias: it points one domain name to another canonical name rather than directly to an IP address. This lets many names "inherit" the configuration of a single target domain.

How a CNAME record works

When a resolver encounters a CNAME, it does not stop there — it follows to the named canonical name and reads the actual A record or AAAA there. For example, www.example.com can be an alias for example.com, which in turn resolves to the server's IP. This type comes with important limitations:

  • a CNAME record cannot coexist with other records for the same name (such as MX or TXT),
  • it is not used on the root (apex) domain — there you use an A record or an ALIAS feature,
  • alias chains lengthen resolution time, so they are best avoided.

The CNAME record in practice

CNAME is convenient when the target address may change and you want to manage it in one place. Typical uses include pointing a subdomain at an external service — a panel, a SaaS store or a CDN — or verifying domain ownership as required by providers. If the target service changes its IP address, it only has to update its own A record; all CNAME aliases automatically start pointing to the new location, with no action on your side.

Powiązane pojęcia

Najczęstsze pytania

Can I set a CNAME record on the root domain?

Per the standard, a CNAME record should not be placed on the root (apex) domain, because it conflicts with the mandatory SOA and NS records. Many DNS providers work around this with an ALIAS feature or CNAME flattening, which resolves the target domain's IP at the server level.