Quick answer: A CNAME record makes one hostname an alias of another — for example, www.example.comexample.com. Create it in your DNS panel with the alias as the host and the target name (not an IP) as the value. A CNAME cannot be placed on the bare domain itself.

Overview

CNAMEs keep DNS tidy: when the target's IP changes, every alias follows automatically. Typical uses are www, staging or app subdomains, and verification hosts required by external services.

Before you start

  • The target hostname the alias should follow (e.g. the bare domain that has the A record).
  • Access to the authoritative DNS panel.
  • Awareness of the main restriction: no other records may exist on the same name, which is why the zone apex (@) cannot be a CNAME.

Step-by-step guide

  1. In the DNS panel, add a record of type CNAME.
  2. Host: the alias, e.g. www or staging.
  3. Value: the target name, e.g. example.com. (many panels require or add the trailing dot).
  4. Save and verify:
dig +short CNAME www.example.com
dig +short A www.example.com   # should resolve through to the target IP

Common issues

  • CNAME at the apex: most providers refuse it; use an A record (or the provider's ALIAS/ANAME flattening) for @.
  • MX pointing to a CNAME: not allowed by the standards — mail targets must be A/AAAA names (MX records).
  • Chained CNAMEs: alias → alias → target works but adds lookups; point straight at the final name.

When to contact support

CNAMEs live at your DNS provider, but if you are aliasing something toward your Cloud2Y server and the final resolution does not reach the right IP, open a ticket with the dig output and we will help untangle it.

Frequently asked questions

What is a CNAME record used for?

A CNAME makes one hostname an alias of another, so www.example.com can follow example.com automatically. When the target's IP changes, every alias updates with it.

Why can't I put a CNAME on my bare domain?

The DNS standard forbids a CNAME to coexist with other records, and the zone apex always has SOA and NS records. Use an A record or your provider's ALIAS/ANAME feature instead.

Should www be a CNAME or an A record?

Both work. A CNAME pointing www to the bare domain is easier to maintain because it follows IP changes automatically; a second A record with the same IP is equally valid.

Related articles

Ready to get started? Order a VPS at Cloud2Y →

Was this answer helpful? 0 Users Found This Useful (0 Votes)