AWS Route53 Alias value
Consider a domain registered on AWS Route53. HTTP requests to this domain should be served from a AWS CloudFront CDN distribution. In order to achieve this, an alias A
record is defined:
dig
results
However, dig
results shows actual IP addresses. In fact, these IP addresses are not constant and change over time:
# dig @1.1.1.1 serverlessdaystlv.io
...
;; ANSWER SECTION:
serverlessdaystlv.io. 60 IN A 13.32.67.21
serverlessdaystlv.io. 60 IN A 13.32.67.27
serverlessdaystlv.io. 60 IN A 13.32.67.97
serverlessdaystlv.io. 60 IN A 13.32.67.122
serverlessdaystlv.io. 60 IN A 13.32.67.141
serverlessdaystlv.io. 60 IN A 13.32.67.159
serverlessdaystlv.io. 60 IN A 13.32.67.201
serverlessdaystlv.io. 60 IN A 13.32.67.216
# dig @1.1.1.1 serverlessdaystlv.io
...
;; ANSWER SECTION:
serverlessdaystlv.io. 60 IN A 52.222.232.13
serverlessdaystlv.io. 60 IN A 52.222.232.24
serverlessdaystlv.io. 60 IN A 52.222.232.43
serverlessdaystlv.io. 60 IN A 52.222.232.55
serverlessdaystlv.io. 60 IN A 52.222.232.63
serverlessdaystlv.io. 60 IN A 52.222.232.104
serverlessdaystlv.io. 60 IN A 52.222.232.136
serverlessdaystlv.io. 60 IN A 52.222.232.224
My question
What is a Route53 Alias record? Is it a built-in type of a DNS record, or simply an internal AWS alias for the actual IP of the CloudFront distribution that is never exposed to the outside?
Route53 alias records is an own concept separate from DNS protocol record types: e.g.
A
is an address record andCNAME
is a canonical name record.CNAME
is the one that acts like an alias pointing to the canonical name, whileA
has nothing to do with aliases. (See RFC 1035.)An alias record is an internal Amazon specific pointer working on a higher level; on technical DNS level it may result as an
A
or as aCNAME
, depending on the situation. The DNS doesn't need to be aware of this internal pointer type nor target, as Route53 only answers with the resulting record.An Amazon article Choosing Between Alias and Non-Alias Records explains this in detail:
The confusion is understandable, as you seem to be adding an
A
type IPv4 address record while the target is a hostname instead of an IP address; something you would rather use with aCNAME
!