How to point your DNS zone apex (root, naked domain) to Azure CDN endpoint?

DC 6 Reputation points
2020-06-11T03:49:33.983+00:00

I would like to point both mydomain.com and www.mydomain.com to my CDN endpoint. I don't see how this can be done via Azures DNS zone.

Has anyone done this and is there a simple solution?

Thanks!!

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
593 questions
Azure Content Delivery Network
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. suvasara-MSFT 10,001 Reputation points
    2020-06-11T20:24:20.777+00:00

    Greetings,

    You should use alias records to point your DNS zone apex to Azure CDN endpoints. If your domain DNS provider does not support alias record for root domain, you could optionally to host your domain in Azure DNS.

    In the Azure DNS zone, you could create an alias record like this,

    80469409-25a93a00-895e-11ea-9384-428d140a76c5.png
    80469458-35288300-895e-11ea-81af-87f28d168571.png

    After the records are verified, you could add the hostname in the custom domain of your CDN endpoint.
    Alternatively, you could try the workaround in this blog.

    If you would like to provide a feedback on this feature then I would recommend you to up-vote this feature here in this Azure feedback section.

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    1 person found this answer helpful.

  2. DC 6 Reputation points
    2020-06-15T20:40:37.677+00:00

    Simple Solution:

    On the CDN endpoint page, under Settings in the side bar, select Rules Engine.

    Configure a rule to redirect the mydomain.com to www.mydomain.com:

    • Add Rule
      -> Add condition -> Request URL (Operator: Equals; Request URL: mydomain.com); Case Transform: to lowercase)
      -> Add action -> URL redirect ( Type: permanent redirect; Protocol: HTTPS; Hostname: www.mydomain.com)

    That was it. Redirection works fine.

    1 person found this answer helpful.
    0 comments No comments

  3. DC 6 Reputation points
    2020-06-12T21:40:17.163+00:00

    Thank you for your quick response.

    I have done exactly what you suggest and I am using Azure for DNS. But this solution you propose becomes a problem when you the apex custom domain to the CDN endpoint. CDN will NOT provide the certificate for the apex domain (by design).

    The only option that I have found is to create a certificate and set everything up in a common AD. However, I am not totally convinced that will work correctly either.

    Being able to have CDN support licensing (shared or otherwise) for the apex domain on the endpoint would be a better solution. Having DNS handle the mapping of the apex to the appropriate submain would ideal.

    I have seen postings where some people considered leaving Azure and moving to other hosting services where this is far simpler. However, that is not my intention, but I do really need this to work. Given the state of the documentation, very wordy and usually a out of date, I wanted to reach out and see if this problem had been solved any someone. Knowing that there is a working solution would help.

    Thanks!

    0 comments No comments