Search code examples
azurednsazure-cdnnamecheap

Azure CDN - Custom hostname without www not working (NameCheap)


I'm trying to add a custom domain without www to Azure CDN services.

With www it's working perfectly. But without www I get an error (see first image)

Azure CDN without www

Azure CDN with www

enter image description here

I'd appreciate any help.


Solution

  • Refer to RFC 1912 - Section 2,4

    A CNAME record is not allowed to coexist with any other data. In other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't also have an MX record for suzy.podunk.edu, or an A record, or even a TXT record.

    a CNAME can not be used at the apex (aka root) of a domain, so we can not use the CNAME records for the root domain as the custom domain in the CDN profile.

    As a workaround, set up a CNAME cdnverify.<yourdomain> to cdnverify.<endpoint>.azureedge.net. Once all is verified and set up (including SSL provisioning if desired), delete the CNAME and use ANAME for the root record. Read this blog for more details.

    The official recommended method is to create alias records in the Azure DNS. See Point zone apex to Azure CDN endpoints. If so, you will delegate DNS zones with Azure DNS and configure alias records for your CDN profile.

    Edit

    Please note that

    Pointing a zone apex to CDN endpoints for Azure CDN from Akamai is currently not supported.

    You could change to use other CDN tiers if you're using Azure CDN from Akamai.