Which should I pick and why? Firebase recommends CNAME records but why? Isn't it better to point to the ip address rather than point to another domain that points to the ip address?
Firebase recommends CNAME records but why?
Firebase hosting is probably marking CNAME
records as recommended because they are widely allowed for setup by registrars and the easiest to setup for most novices when setting up their wildcards.
Isn't it better to point to the ip address rather than point to another domain that points to the ip address?
YES you are correct. It is going to be a faster lookup because it will not have to do 2 lookups (the CNAME then the pointed domain name).
Firebase Hosting gives you the option to add A
records in your DNS with not just one IP address but two for even better performance.
Which should I pick and why?
You will have a choice here.
A
records pointing to IP addresses if allowed first if you are not concerned the IP address will change for the hosting server. Will Firebase Hosting change IP addresses in the future? Maybe, but probably not very often. NOTE: Both of these options could require a change if Firebase Hosting decides to make a domain name
or IP Address
change to their hosting services, but I would suspect they would notify you ahead of time as soon as that is going to happen.
My choice is to use A
record pointers in this case because we are dealing with Google here and typically are good about notifications of changes. I can change an IP address as quickly as a domain name in a DNS configuration.