How to cname a domain

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: CNAME (Canonical Name) records are DNS records that map an alias domain name to a true or canonical domain name. To CNAME a domain, you typically access your domain registrar's DNS management panel, find the section for managing DNS records, and create a new CNAME record, specifying the alias and the target canonical domain.

Key Facts

What is a CNAME Record?

A CNAME record, short for Canonical Name record, is a type of resource record in the Domain Name System (DNS) that specifies an alias of a domain name. Essentially, it tells DNS servers that one domain name is an alias for another, canonical (true) domain name. This is different from other DNS record types like A records (which map a domain name directly to an IP address) or MX records (which handle mail exchange).

For example, if you have a website hosted on a platform like Heroku or AWS, and they provide you with a domain like myapp.heroku.com, you can use a CNAME record to point your custom subdomain, such as www.yourdomain.com, to myapp.heroku.com. When a user types www.yourdomain.com into their browser, the DNS lookup will follow the CNAME record, find the canonical name myapp.heroku.com, and then resolve that to the correct IP address provided by Heroku.

Why Use CNAME Records?

CNAME records offer several advantages:

How to Create a CNAME Record

The process of creating a CNAME record typically involves logging into your domain registrar's control panel or your DNS hosting provider's interface. The exact steps can vary slightly depending on the provider, but the general procedure is as follows:

  1. Log in to your Domain Registrar/DNS Provider: Access your account where you manage your domain's DNS settings. Common providers include GoDaddy, Namecheap, Cloudflare, Google Domains, AWS Route 53, etc.
  2. Navigate to DNS Management: Look for a section labeled 'DNS Management', 'Zone Editor', 'Advanced DNS', 'Nameserver Settings', or something similar.
  3. Add a New Record: Find an option to 'Add Record', 'Create Record', or similar.
  4. Select Record Type: Choose 'CNAME' from the dropdown list of record types.
  5. Enter the Host/Name Field: This is the alias you want to create. For a root domain (e.g., example.com), you generally cannot use a CNAME. However, for subdomains like www, blog, or shop, you would enter just that part (e.g., www). Some interfaces might require the full subdomain like www.yourdomain.com, while others use a special character like '@' for the root domain (though CNAMEs are problematic here).
  6. Enter the Value/Target/Points To Field: This is the canonical domain name that the alias will point to. It must be a fully qualified domain name (FQDN) and cannot be an IP address. For example, ghs.googlehosted.com or your-app.herokuapp.com.
  7. Set TTL (Time To Live): The TTL determines how long DNS resolvers cache the record. A lower TTL means changes propagate faster but can increase DNS lookup load. A common default is 3600 seconds (1 hour).
  8. Save the Record: Confirm and save the new CNAME record.

Important Considerations and Limitations

While CNAME records are powerful, they come with specific rules and limitations:

CNAME vs. Other DNS Records

Understanding how CNAMEs differ from other common DNS records is crucial:

In summary, CNAME records are a flexible tool for managing domain aliases, particularly for subdomains pointing to external services or for simplifying DNS management when underlying IP addresses might change. Always remember the restriction on root domains and the time required for DNS propagation.

Sources

  1. CNAME record - WikipediaCC-BY-SA-4.0
  2. What is a CNAME record? | Cloudflarefair-use
  3. Understanding Domain Names | ICANNfair-use

Missing an answer?

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