How to cname record

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: A CNAME (Canonical Name) record is a type of DNS record that maps an alias name to a true or canonical domain name. It's commonly used to point a subdomain to another existing domain, like pointing 'www.yourdomain.com' to 'yourdomain.com' or an alias to a service like a CDN or cloud hosting provider.

Key Facts

What is a CNAME Record?

In the realm of the Domain Name System (DNS), records are essential components that help translate human-readable domain names into machine-readable IP addresses. Among these, the CNAME (Canonical Name) record plays a unique role. Unlike other DNS records that point directly to an IP address (like A records for IPv4 or AAAA records for IPv6), a CNAME record acts as a pointer to another domain name. Essentially, it establishes an alias, indicating that one domain name is an alias for another, the 'canonical' or true name.

Why Use CNAME Records?

The primary purpose of a CNAME record is to simplify management and provide flexibility. Here are some common use cases:

How CNAME Records Work

When a DNS resolver queries for a hostname that has a CNAME record, the resolver receives the canonical name as the answer. It then must perform a second DNS lookup for that canonical name to find its corresponding IP address. This process is transparent to the end-user, but it does add an extra step in the DNS resolution process, which can slightly increase latency.

Important Considerations and Limitations

While CNAME records are powerful, they come with certain restrictions:

How to Create a CNAME Record

The process of creating a CNAME record is done through your domain registrar or DNS hosting provider's control panel. The exact steps may vary, but generally, you will:

  1. Log in to your domain's DNS management interface.
  2. Navigate to the DNS records section.
  3. Create a new record.
  4. Select 'CNAME' as the record type.
  5. Enter the hostname or subdomain you want to alias (e.g., 'www', 'blog', or 'shop').
  6. Enter the target canonical domain name (e.g., 'yourdomain.com', 'ghs.googlehosted.com', or a CDN domain).
  7. Set the TTL (Time To Live), which determines how long DNS resolvers cache the record. A common TTL is 3600 seconds (1 hour).
  8. Save the record.

After saving, it can take anywhere from a few minutes to 48 hours for the DNS changes to propagate across the internet.

CNAME vs. Other DNS Records

Understanding the difference between CNAME and other common DNS records is crucial:

In summary, CNAME records are a flexible tool for creating aliases within your DNS configuration, simplifying management and enabling integration with various online services. However, it's important to be aware of their limitations, particularly regarding the root domain and coexistence with other record types.

Sources

  1. CNAME record - WikipediaCC-BY-SA-4.0
  2. What is a CNAME record? | Cloudflarefair-use
  3. What is a CNAME record? | Namecheapfair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.