3

It's may be stupid, but I really interested in this question. I want make mirror www subdomain for main and can't choose which property to use...

CNAME looks more solid and clearer. I can set it like this:

www.exmaple.com -> A someIP.

Just don't quite know how Google Cloud DNS behaves. If use CNAME, will the client get an subdomain IP or will he get the name of the main domain and make a second request to get his IP?

P.S. Yes, I understand that the time difference in the execution of requests is so small that should forget it.

Turar Abu
  • 368
  • 1
  • 3
  • 11
  • Only CNAME is standard, all the rests are proprietary kludges to handle the case of a CNAME-like feature at apex. Also the DNS query, since it is cached, is often really not the significant part of time involved for a whole session, especially on the web will all external dependencies on scripts, CSS, fonts, images, etc. – Patrick Mevzek Oct 22 '18 at 18:55

1 Answers1

4

Google Cloud DNS does not support ALIAS resource records.

ALIAS (A) records are usually faster and are typically used for internal services on the same provider. Example would be a load balancer. ALIAS records typically have a short TTL (typically 60 seconds) so that they are constantly being resolved to the service.

When you resolve a CNAME, a subsequent lookup is required for the returned DNS name, which could then be another CNAME, etc.

There are more factors to consider when select an ALIAS versus CNAME. For example:

  • AWS does not charge for ALIAS record lookups but does for CNAME lookups.
  • You cannot use a CNAME for the zone apex (example.com). You can for the subdomains (www.example.com).
  • A CNAME cannot coexist with another resource record of the same name, whereas ALIAS can.
John Hanley
  • 74,467
  • 6
  • 95
  • 159