A DNS CNAME record, which stands for "Canonical Name," is a type of DNS record used to redirect one domain name to another domain name. It is often used to create alias names for a specific domain, allowing multiple domain names to point to the same location on the Internet.
The CNAME record consists of two parts:
- The alias or subdomain name: This is the name you want to link to another domain. For example, if you want to create a CNAME record to point "blog.yourdomain.com" to "yourblogplatform.com," "blog" is the subdomain.
- The target domain name: This is the domain name to which the alias should point. In our example, "yourblogplatform.com" is the target domain name.
A CNAME record ensures that the subdomain (alias) follows the same IP address information as the target domain name. This is useful in situations where you want to use the same content platform for different subdomains without configuring separate IP addresses.
Here are some usage examples of CNAME records:
- Subdomain to hosting provider: You can use a CNAME record to redirect a subdomain, such as "www," to your hosting provider's Web server.
- Content Delivery Network (CDN): CNAME records are often used to send subdomains to a CDN to optimize Web page load times.
- Email services: You can set CNAME records for subdomains that point to e-mail providers for configuring e-mail services.
It is important to note that a domain name may not have another record type with the same name as a CNAME record. If you set a CNAME record for a subdomain, such as "subdomain.yourdomain.com," there must not be an A or AAAA record with the same name, as this can lead to conflicts. In that case, consider setting an alias record using a CNAME for subdomains that need to point to other domain names.