hostgraber - what is cname.png

What Is a CNAME?

A CNAME (Canonical Name) record is a DNS record that points one domain or subdomain to another hostname instead of directly to an IP address.

How Does a CNAME Record Work?

  1. User enters www.example.com.
  2. DNS checks the CNAME record.
  3. The CNAME points to example.com.
  4. DNS resolves the A or AAAA record of the destination.
  5. The browser connects to the correct server.
www.example.com  →  example.com

CNAME Record Example

Host Record Type Value
www CNAME example.com
blog CNAME blog.hostingprovider.com
shop CNAME ecommerce.example.net

CNAME vs A Record

Feature CNAME A Record
Points to Hostname IPv4 Address
Uses IP No Yes
Best For Aliases & Subdomains Main Domain

When Should You Use a CNAME?

  • www subdomains
  • Blogs
  • CDN integration
  • SaaS applications
  • Cloud hosting
  • Website verification

When Should You NOT Use a CNAME?

  • Root domain (in most DNS providers)
  • MX records
  • Nameserver records
  • Direct IP mapping

Advantages

  • Easy DNS management
  • No need to update multiple IP addresses
  • Ideal for cloud services
  • Simplifies website migrations

Disadvantages

  • Extra DNS lookup
  • Usually cannot be used on the root domain
  • Depends on the target hostname

How to Create a CNAME Record

  1. Log in to your DNS panel.
  2. Open DNS Management.
  3. Add a new record.
  4. Select CNAME.
  5. Enter the host (e.g. www).
  6. Enter the destination hostname.
  7. Save the record.
  8. Wait for DNS propagation.

Common Errors

  • CNAME Loop
  • Incorrect Target
  • Conflicting Records
  • DNS Propagation Delay

Frequently Asked Questions

Is CNAME the same as an A record?

No. A CNAME points to another hostname, while an A record points directly to an IP address.

Can I use a CNAME for the root domain?

Generally no. Use an A record or ALIAS/ANAME if supported.

How long does it take?

Usually a few minutes, but global DNS propagation can take up to 48 hours.

Conclusion

A CNAME record is an essential DNS feature that makes domain management simpler by allowing one hostname to point to another. It is widely used for websites, SaaS platforms, cloud hosting, and CDN integrations.