What is a CNAME ?

A CNAME, or Canonical Name record, is a type of DNS (Domain Name System) record used in the configuration of domain names. DNS is the system that translates human-readable domain names, like www.example.com, into IP addresses, which are numerical addresses used by computers to locate and communicate with each other over the internet.

A CNAME record is used to create an alias for a domain name. Instead of directly associating an IP address with a domain, a CNAME points one domain to another domain. This is often used to manage domain redirection and make it easier to update the destination IP address if it changes in the future. Here’s how it works:

Let’s say you have two domains, domainA.com and domainB.com. You want domainA.com to point to the same location as domainB.com. Instead of duplicating the IP address information in the DNS records for both domains, you can create a CNAME record for domainA.com that points to domainB.com. This way, any time someone tries to access domainA.com, the DNS system will look up the CNAME record and then resolve the IP address associated with domainB.com.

Here’s an example of what a CNAME record might look like in DNS configuration:

Name                Type     Value
-----------------------------------
domainA.com.        CNAME    domainB.com.

In this example, when someone tries to access domainA.com, the DNS system will follow the CNAME record and resolve it to the IP address associated with domainB.com, effectively redirecting the traffic.

CNAME records are often used for various purposes, including creating subdomains, pointing domains to content delivery networks (CDNs), and managing domain changes without updating multiple DNS records.