DNS – Can Multiple CNAMES Exist for a Single Name?

cname-recorddomain-name-system

I need this for load balancing. For example, I've two azure storage accounts (say a and b) and the blob addresses for those are a.blob.core.windows.net and b.blob.core.windows.net. Both of them store identical data. Now I need to provide a single external name (say example.com) which points to both the storage accounts and should work in round robin. This can be achieved if I create two CNAME entries in DNS as following and it resolves to one of them in round robing.

  1. example.com CNAME a.blob.core.windows.net
  2. example.com CNAME b.blob.core.windows.net

But I can not create two CNAME records for a single name in Windows DNS server.

So is it ever possible?

Best Answer

Multiple CNAME records for the same fully-qualified domain name is a violation of the specs for DNS. Some versions of BIND would allow you to do this (some only if you specified the multiple-cnames yes option) and would round-robin load-balance between then but it's not technically legal.

There are not supposed to be resource records (RRs) with the same name as a CNAME and, to pick nits, that would include multiple identical CNAMEs. Quoth RFC 1034, Section 3.6.2:

If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.

The letter-of-the RFC method to handle what you're doing would be with a single CNAME referring to a load-balanced "A" record.