question

DC-3079 avatar image
0 Votes"
DC-3079 asked LeighR edited

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

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-dnsazure-cdn
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

suvasara-MSFT avatar image
1 Vote"
suvasara-MSFT answered LeighR edited

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I came across this when trying to redirect apex domains to www as well. The @ reference gave me an idea and wondering if this would work?! ![25097-azurednsalias.jpg][1] [1]: /answers/storage/temp/25097-azurednsalias.jpg I have www configured as an A record set in Azure DNS.

0 Votes 0 ·
DC-3079 avatar image
0 Votes"
DC-3079 answered DC-3079 edited

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!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DC-3079 avatar image
1 Vote"
DC-3079 answered piotr-piatkiewicz commented

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.