What is a CNAME record (Canonical Name record)? How to set an alias in DNS

Explanation of IT Terms

What is a CNAME record (Canonical Name record)?

A CNAME record, short for Canonical Name record, is a type of DNS (Domain Name System) record that can be used to create an alias or nickname for a domain or subdomain. It allows you to point one domain or subdomain to another domain name, effectively redirecting traffic from one address to another.

For example, if you have a website hosted on one domain name, but you want it to be accessible using a different domain name as well, you can use a CNAME record to create an alias. This can be useful in situations where you have multiple domain names pointing to the same website, or if you want to use a different domain name for a specific purpose.

The CNAME record works by mapping the alias domain name to the canonical or real domain name. When a user enters the alias domain name in their web browser, the DNS server looks up the CNAME record and resolves the canonical domain name. The user’s web browser is then redirected to the canonical domain where the website is actually hosted.

How to set an alias in DNS

Setting an alias in DNS using a CNAME record involves a few steps, but it is typically straightforward. Here is a general guide:

  1. Access your DNS settings: Log in to your domain registrar or DNS hosting provider’s website and find the DNS settings or DNS management section for the domain you want to set the alias for.
  2. Create a CNAME record: Look for an option to create a new record and select CNAME as the record type. Enter the alias or subdomain name in the “Alias” or “Name” field, and then enter the canonical domain name in the “Canonical Name” or “Value” field.
  3. Save the changes: After entering the necessary information, save the changes or update the DNS records for your domain.
  4. Propagation: DNS changes can take some time to propagate across the internet. It may take several minutes to several hours for the changes to take effect, although it is usually faster.
  5. Testing: Once the changes have propagated, you can test if the alias is working by entering the alias domain name in a web browser. It should redirect to the corresponding canonical domain or website.

Note that creating a CNAME record for the root domain (e.g., example.com) is not possible as per the DNS specification. CNAME records can only be created for subdomains or aliases.

It’s essential to remember that DNS settings may vary depending on your domain registrar or DNS hosting provider. If you are unsure or need assistance, it is recommended to consult the support documentation or contact your domain provider for guidance.

Reference Articles

Reference Articles

Read also

[Google Chrome] The definitive solution for right-click translations that no longer come up.