Skip to content
Domains and DNS2 min read

What is a CNAME record?

Short answer

A CNAME (canonical name) record makes one name in your domain an alias of another name, borrowing that name's address. For example, www.example.com can point to example.com, or shop.example.com to an external store platform. It can't be used on the root domain itself.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Format
  2. CNAME or A?
  3. Key limits
  4. Practical example: a subdomain for a Salla or Zid store
  5. On ArabyHost

The beauty of a CNAME is that you don’t need to know an IP address. If the external platform changes its server addresses, your name follows automatically, because it points to their name rather than a number. That’s why most platforms hosting part of your site, such as stores, landing-page builders and CDNs, ask for one.

Format

www.example.com.   3600  IN  CNAME  example.com.
shop.example.com.  3600  IN  CNAME  shops.myshopify.com.

When the browser looks up shop.example.com, it finds the CNAME, then looks up shops.myshopify.com and uses its address.

CNAME or A?

Situation Record
Root domain example.com A record
www following the root CNAME or A
Subdomain for an external platform CNAME
Domain verification for some services CNAME or TXT, as the service asks

Key limits

  • No CNAME at the root: the root holds NS and SOA records, and DNS rules forbid a CNAME alongside any other record for the same name. Some providers offer a workaround called CNAME flattening or ALIAS.
  • Nothing else beside it: you can’t have a CNAME plus a TXT or MX on the same name.
  • MX records must not point to a CNAME: an MX must point to a name with an A record.
  • Long chains: a CNAME pointing to another CNAME works, but adds lookups and slows resolution a little.

Practical example: a subdomain for a Salla or Zid store

Store platforms usually ask for a CNAME on www or store pointing to a name of theirs. You’ll find the exact value in the platform’s dashboard, and the steps in connecting a domain to Salla and connecting a domain to Zid. Then check it with:

dig CNAME www.example.com +short

On ArabyHost

If your nameservers are ns1.arabicode.com and ns2.arabicode.com, add CNAME records in the control panel’s DNS editor. Don’t add a CNAME on a name already used for email or the website, such as the root domain or mail, or that service will break. To check the result, use the DNS lookup tool.

FAQ

Can I put a CNAME on the bare domain, without www?

Not under DNS rules, because the root already holds other records such as NS and SOA. Use an A record, or ALIAS / CNAME flattening if your DNS provider offers it.

Does a CNAME redirect visitors to another URL?

No. A CNAME works only inside DNS, and the address in the browser stays the same. To send visitors to a different URL, use a 301 redirect.

Why won't my DNS editor let me add a CNAME?

Usually because the same name already has another record, such as A, TXT or MX. Remove that record first, or use a different subdomain.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.