Just want to see if I understand this correctly.
CNAME record specifies an alias, in the following form:
alias CNAME canonical-domain
Which means if something is trying to look up alias, it will find the CNAME record and start searching for canonical-domain instead.
A record directly maps a host to an IP
host A IP-addr
So if I have 2 domains eventually pointing to the same IP addr, one is a canonical domain and another is an alias domain, I would use an A record for the canonical domain->IP mapping, and a CNAME record for the alias->canonical mapping.
Why can't I just use 2 A records, one being canonical->IP mapping and the other being alias->IP mapping? Is it so that you only have to update the IP once if you ever need to change it? (Analogy would be CNAME is a softlink and A record is a file in a filesystem)
A
records, no-one forbids you that. It's even a bit faster as only 1 lookup is required (when withCNAME
it is at least 2). In fact -- some records (e.g.MX
) require server address (e.g.mail.example.com
) to beA
record and notCNAME
. – LazyOne