-1

Is A significantly faster than CNAME in this case?

$ dig www.google.com

; <<>> DiG 9.8.1-P1 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28336
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         13      IN      A       173.194.78.103
www.google.com.         13      IN      A       173.194.78.106
www.google.com.         13      IN      A       173.194.78.105
www.google.com.         13      IN      A       173.194.78.99
www.google.com.         13      IN      A       173.194.78.147
www.google.com.         13      IN      A       173.194.78.104

;; Query time: 11 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jan 24 10:22:28 2013
;; MSG SIZE  rcvd: 128
2
  • 3
    Why should they ever use a CNAME? A CNAME would require two lookups at the client side and there seems absolutely no necessity to use it.
    – the-wabbit
    Jan 24, 2013 at 10:26
  • 1
    How would we know and why would we care?
    – joeqwerty
    Jan 24, 2013 at 13:32

3 Answers 3

7

Well, if you are Google, with many millions of DNS queries a day, I would say reducing the queries by 50% is significant.

4

The primary goal to use CNAME RRs is to ease DNS zone administration. As it is just a pointer to another label with all its RRs (not just A RRs by the way, all RRs), in the olden days, where changing RRs would involve firing up vi to edit the BIND-style zone file you would have less work to do if you ever needed to change RRs.

Google zones are certainly not edited by hand in BIND-style files, so the utility of CNAME records would be questionable. Additionally, google uses geo-DNS, where the RR reply would depend on from where you are querying - static CNAMEs would not help there at all.

Also, whenever a DNS query for a label results in a CNAME response, another query has to be performed to get the RR of the CNAME destination label. The adverse latency and resource consumption effects are mostly neutralized by caching resolvers at the ISP's side, but if there is no specific need for CNAMEs, they simply should not be used.

2
  • Do you think A records could be multiple but CNAME cannot, which using multiple A records would helps in load balancing?
    – neo
    Jan 24, 2013 at 11:04
  • @neo Using Geo-DNS is about exercising control over what data is returned for which query from which location. Using CNAME records is doing pretty much the opposite - delegating control to the destination zone. So while having a setup where you control both zones still might work out for a specific application, it does not make much sense conceptually to use CNAMEs in such a setup.
    – the-wabbit
    Jan 24, 2013 at 11:37
0

I would say that A is faster than CNAME in any case! Because when you look for ip address for domain with cname record dns always do twice much work then looking only for A record.

Not the answer you're looking for? Browse other questions tagged .