Skip to content
Help Center

What is a CNAME record and when should you use one?

CNAME Record: what it is, what it's for, and how it relates to domains and DNS within a hosting service.

Quick summary

  • What it is: A CNAME Record (Canonical Name Record) is a type of record in the Domain Name System (DNS) used to make one domain name an alias of another name.
  • What it's for: it helps connect the domain with the website, email and other associated services.
  • When to check it: when changing DNS servers, connecting a domain, configuring email or reviewing propagation.

A CNAME Record (Canonical Name Record) is a type of record in the Domain Name System (DNS) used to make one domain name an alias of another domain name. This means that the CNAME Record points to another domain name instead of directly to an IP address, as an A or AAAA record would.

Characteristics and function of the CNAME Record:

  • Domain alias: A CNAME Record allows a subdomain to be an alias of another domain name. For example, you can have a subdomain like www.example.com that points to example.com.
  • Ease of management: By using a CNAME, changes to IP addresses only need to be updated in one place. If the domain name that the CNAME points to changes its IP address, you do not need to update the CNAMEs that point to that name.
  • Not used for root domain names: CNAME records cannot be used for top-level domain names (the main domain part like example.com); they are only applicable to subdomains.

Example of configuring a CNAME Record:

Imagine you want www.example.com to point to example.com. Your CNAME record might look like this in your DNS zone file:

www.example.com. IN CNAME example.com.

In this example:

  • www.example.com. is the subdomain you want to set up as an alias.
  • "IN" indicates it is an Internet record.
  • "CNAME" designates that the record type is Canonical Name.
  • example.com. is the domain name that www.example.com will point to.

Common uses of CNAME records:

  1. Subdomains: CNAMEs are ideal for directing multiple subdomains to a main domain where the website is hosted. For example, pointing www.example.com, blog.example.com and store.example.com to example.com.
  2. Third-party services: Often used to connect domain names with external services, such as email platforms, e-commerce platforms or content hosting services.

Limitations of CNAME records:

  • Cannot coexist with other records: A CNAME for a subdomain cannot coexist with any other type of DNS record for that same subdomain.
  • Not for MX or NS records: You should not use a CNAME for domain names that need MX (Mail Exchange) or NS (Name Server) records, as it can cause DNS resolution problems.

CNAME records are powerful tools within the DNS system, providing flexibility and simplification in managing domain names and address resolution. However, they should be used with caution and understanding of their limitations to avoid complications in DNS configuration.

Why it matters in hosting

Understanding this concept will help you make better decisions when managing your service. In practice, it relates to the connection between the domain, the website, email and other associated services. If it appears in a guide, the control panel or a support response, review the context before making changes.

Related articles

  • Domain
  • DNS
  • Nameservers
  • A Record
  • MX Record