CNAME Explained (An Alias for a Hostname)
A CNAME, short for canonical name, is DNS record type 5. The value is another hostname, the canonical name, not an address. www.example.com can point at example.com. The resolver returns the CNAME, looks up example.com, and uses that name's A or AAAA record. The browser still requests www.example.com.
- The value is a hostname, never an IPv4 or IPv6 address.
- The target may be in the same domain or a different one.
- The name that holds the CNAME cannot also hold A, MX, TXT, or a second CNAME.
- One address change on the target updates every alias that points at it.
The alias can target the same domain or a different one, such as a shop or CDN hostname. Change the address on the target and every CNAME that points there follows. The wider set of record types is in DNS records explained.
CNAME vs A Record
An A record stores an IPv4 address. A CNAME stores a hostname and sends the resolver to look that name up. Use an A record for the bare domain and for mail hosts. Use a CNAME when a label should keep following another hostname, such as www.
| Factor | CNAME | A record |
|---|---|---|
| Points to | Another hostname | An IPv4 address |
| DNS type | 5 | 1 |
| Coexistence | Must be the only record at that name | Can sit with MX, TXT, and NS |
| At the apex | Not valid, because SOA and NS already exist | Normal for the bare domain |
| After an IP change | Follows the target | Edit each A record |
| Typical use | www, a CDN hostname, a verification name | Apex and mail hosts |
Mail and the apex need records that can share a name. A CNAME cannot. The side-by-side choice, including when mail is involved, is in A record vs CNAME.

The Root-Domain Rule: Why the Apex Needs A or Flattening
The apex is the bare domain, example.com, with no label in front. That name already has SOA and NS records. A CNAME has to be the only record at its name, so a normal CNAME on the apex is invalid. Put an A record, and an AAAA record if you publish IPv6, on the apex. Put the CNAME on www or another label.
Some DNS hosts offer a panel row that looks like a CNAME at the root and answers with an address. A cPanel zone stores a real CNAME, so it will not accept that on the apex. The workaround is the flattening section below.
Common Uses: www, CDN and SaaS Verification
Three uses cover almost every CNAME on a hosting account. Point www at the apex so both names share one address. Point a hostname at a CDN or platform name they gave you, so they can change servers without you editing an A record. Add the verification CNAME a vendor sends, on a label that has no other record.
A CNAME to another company's domain only publishes the alias. Their server still has to accept your hostname. It is also not an HTTP redirect: the address bar keeps the name people typed.
Creating a CNAME in the cPanel Zone Editor
Linux shared and WordPress plans use cPanel for the zone. Edit that zone only when the domain's nameservers already point at the account. A matching record saved at the registrar does nothing while those nameservers point at the host.
- Confirm the live nameservers are the account whose Zone Editor you are opening.
- In cPanel, open Zone Editor and choose Manage beside the domain.
- Add a CNAME record. In Name, type only the label, such as www or shop.
- In the target field, type a hostname, not an IP. Save the row.
- Look up the full name. The CNAME answer should be that hostname. The address appears only on the next lookup.
You know it worked when Zone Editor shows type CNAME and a lookup of the full name returns the target, not an IP, in the CNAME answer. If the saved name is www.example.com.example.com, Name included the domain and the panel appended it again. Change Name to the label only, such as www.
CNAME Not Working: Propagation and Conflicts
A CNAME fails for a short list of reasons. Another record on the same name blocks it. A target with no A or AAAA record, or a chain of CNAMEs that never reaches one, returns no address. A chain is allowed and adds lookups. Point at the final hostname when you can.
Confirm the registrar lists the nameservers for the zone you edited. If a lookup still shows the old answer, caches have not expired yet. How long that takes is DNS propagation, and a fresh lookup is how you check DNS records.
CNAME Flattening (Workaround Explained)
CNAME flattening, ALIAS, and ANAME are names for the same idea. You type a hostname at the apex, and the DNS host looks it up and answers with an address. On the wire that answer is not a CNAME, which is why SOA, NS, and MX can remain.
A WebJi® cPanel zone has no flattening switch. Keep an A record on the apex and use a CNAME only on a label such as www. If a vendor requires the apex itself to be a CNAME, the zone has to live at a DNS host that offers flattening or ALIAS. Do not delete the apex NS or SOA records to force one.
Frequently Asked Questions
What is a CNAME record?
A CNAME (canonical name) record is DNS type 5. It points one hostname at another hostname. Resolvers then look up that target for the A or AAAA address.
Can a CNAME record be an IP address?
No. The value must be a hostname. An IPv4 address belongs in an A record, and an IPv6 address belongs in an AAAA record. If a panel stores an IP in a CNAME field, that record is invalid.
Can you have a CNAME without an A record?
The CNAME name itself has no A record, and it must not have one. Visitors still need some name in the chain to have an A or AAAA record. Until that target has an address, the alias does not resolve.
Can a CNAME point to a different domain?
Yes. www.example.com can point at example.com, or shop.example.com can point at a hostname the shop platform gave you. Their server has to answer for your hostname. The CNAME only publishes the alias.
Is a CNAME just a redirect?
No. A CNAME changes which address a name resolves to. The browser still requests the original hostname. A redirect is an HTTP response, such as a 301, and it can change the address people see. The two settings are separate.
Can I add a CNAME at the root domain?
Not as a standard CNAME. The bare domain already has SOA and NS records, and a CNAME cannot share that name. Use an A record on the apex. Use a CNAME on www or another label. Flattening or ALIAS belongs to some DNS hosts, not to a normal cPanel zone.
Why is my CNAME not working?
Check four things: the name has no other record, the target hostname has an A or AAAA record, you edited the zone the live nameservers publish, and old caches have expired. A doubled name such as www.example.com.example.com means the label was entered as a full domain.

