When you configure the records in the Hosted Zone of Route 53, it can be difficult to understand the difference between CNAME and Alias. This article will help you overcome this confusion because it is actually very easy.
Before understanding CNAME and Alias in hosted zone you need to understand the related concept that AWS Resources will generate URL paths such as Load Balancer ELB or CloudFront. And often we configure Route 53 in general or in a hosted zone in particular, we will often encounter this situation.
An example of an ELB might look like this:
To configure the Hosted Zone, you need to point the DNS Name of the domain you manage to the AWS NS records.
Used to point hostname to any other hostname. For example, if you have a domain cloudemind.com, the CNAME can point demo.cloudemind.com to another hostname such as demo.anydomain.com
CNAME only works with Non-root domain. In other words, you need to create a sub-domain to configure.
You may incur charges for using a CNAME.
Alias looks quite similar to CNAME, but Alias to point hostname to an AWS Resources example above can be ELB or CloudFront DNS name.
Alias can work with both Root domains and non-root domains.
Alias is free so Kevin recommends using config.
In addition, Alias can support native health check to see if the following entities are healthy or ready.
AWS Exam questions
CNAMEs and Alias are also a frequently asked topic on the AWS Certified Associate exam. The exam may ask you to configure the root domain, you need to remember that it is using Alias, and non-root domains can use both CNAME and Alias.