Wednesday, August 31, 2016

Azure Traffic Manager - CNAME Flattening

Scenario: You have moved some VMs into the cloud, where they serve your website. You have several VMs which are load balanced within one Azure region, and another bunch of identical VMs in another Azure region for high availability reasons. You deployed an Azure Traffic Manager to load balance between both Azure regions. Your Azure Traffic Manager URL is  and your website's domain is

Issue: When you try to create the CNAME "" record for "", your DNS provider will reject it, saying that it violates RFC1912 - which states that:

  • A CNAME record is not allowed to coexist with any other data,
  • 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.

"" type of record is commonly known as (all terms are interchangeable):

  • Root URL
  • Apex URL
  • Naked URL

The alternative would be to use "" instead and but your company have probably invested a lot of money on SEO to ensure that "" shows up high in search ranking results.

Resolution: At the moment, CloudFlare seems to be your best bet. They introduced "CNAME flattening" back in March 2014 which allows exactly the scenario we need.

Read more about CNAME Flattening here:

I've tested it with Azure Traffic Manager and it works perfectly.

No comments: