Ref: https://learn.cantrill.io/courses/1820301/lectures/41301581
Limitations of CNAME Records
- 💡 Refresher: CNAME records map hostname to hostname
- e.g.
www.catagram.io → catagram.io
- 👎 Limitation of CNAME records: can NOT map the domain apex (i.e. the naked domain)!!
- e.g.
catagram.io → www.animals4life.org
is NOT valid with CNAME records!
- DNS standard does not support this functionality
- Many AWS services (e.g. ELBs) grant access via a DNS name, not an IP address
www.catagram.io → ELB
is valid with CNAME records…
- ‼️…but
catagram.io → ELB
is invalid!!
- R53 Alias records overcome this limitation
R53 Alias Records
- đź”§Â AWS-exclusive record outside of the DNS standard
- Main function: Map hostname to an AWS resource
- For non-apex/non-naked names → functions like CNAME
- âť—Â Allows apex/naked domain to be mapped, unlike CNAME!
- ‼️  Can only be used if R53 is hosting your domains!
- Actually a subtype of normal DNS records
- e.g.
A-ALIAS
, TXT-ALIAS
…
- Determine type of R53 Alias record by matching it to what the AWS resource returns
- e.g. ELB returns an
A
record → create an A-ALIAS
record pointing at the DNS name provided by the ELB
- Can point to services like APIGW, CloudFront, Elastic Beanstalk, ELB, Global Accelerator, S3…
- ‼️ No charge for ALIAS requests pointing at AWS resources!
- AWS encourage you to use ALIAS records
- 💡 For anything pointing to an AWS resource, default to picking ALIAS records