What is the difference between an alias record and a CNAME record in Route 53?
A CNAME maps one name to another name and cannot be used at the zone apex like example.com. An alias record is a Route 53 feature that can point even the apex to AWS resources, is free to query, and follows the resource's IP changes.
Explain it simply
A CNAME is a contact card that says "for this person, see that other card". It works for named people but cannot replace the main office entry at the top of the directory. An alias is a smart speed-dial that AWS keeps updated itself, even for the main number.
Example
example.com (zone apex) -> CNAME NOT allowed by DNS rules
www.example.com -> CNAME allowed
Alias A record
example.com -> d111111abcdef8.cloudfront.net (CloudFront)
example.com -> my-alb-123.ap-south-1.elb.amazonaws.com (ALB)
shop.example.com -> S3 static website endpoint
Alias targets: CloudFront, ELB, S3 website, API Gateway, other Route 53
records in the same zone, and similar AWS resourcesAlias records have no query charge when pointing to AWS resources, can have health evaluation, and show up as normal A or AAAA records to clients.
An alias cannot point to an EC2 instance's DNS name or to non-AWS targets. For those, use an A record with the IP or a CNAME in a non-apex position.
What to say in the interview
"A CNAME can't sit at the root domain, but a Route 53 alias can, and it is free for AWS targets and tracks IP changes automatically. So for example.com pointing to a load balancer or CloudFront, I use an alias A record."
Common mistakes
- Trying to create a CNAME for the root domain.