question

PaulMckenna-7202 avatar image
0 Votes"
PaulMckenna-7202 asked JasonH-7169 published

Redirect @ to www in Azure DNS

Hi there, I need to manage a domain from Azure DNS. I need to point that domain at an external website. I have created a CNAME for my www subdomain to the external website and that works fine, but I need the root address to work for this as well.

EG:
My domain: example.com
External site: other.com

I have created a CNAME for www.example.com => other.com

This works fine. I can go to https://www.example.com and I will see the other.com site. However when I go to https://example.com I get an error ("This site cannot be reached").

On other platforms I can create a redirect for @ => www.example.com

How can I do this on Azure? I need to advise many people on how to do this for their sites and many are not technical so the solution will need to be through the UI console.

Thank you in advance

azure-dns
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.

JayKim-2272 avatar image
1 Vote"
JayKim-2272 answered JayKim-2272 commented

maybe this problem is solved already
but i overcome the same issue using Azure front door

so, DNS zone, A record to alias Azure front door and www CNAME to front door
and from front door you set
1. example.com to www.example.com redirect
2. www.example.com to other.com redirect





· 2
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.

Generally this kind of problem is solved by creating a wildcard record, I would say. So <anything or nothing>.example.com will point to the same server when there is no other matching records inside the domain.


1 Vote 1 ·

i believe i have tried that too but didn't work

so you mean in the DNS Zone create CNAME recoard with *.example.com alias other.com right?

1 Vote 1 ·
GitaraniSharmaMSFT-4262 avatar image
1 Vote"
GitaraniSharmaMSFT-4262 answered

Hello @PaulMckenna-7202 ,

I believe you are looking for something like 301 (Permanent) redirect service for apex (naked) domains.
For e.g:
(1) The root domain (example.com) should 301 (permanent) redirect to the www CNAME (www.example.com)
(2) The www CNAME (www.example.com) should direct to the external website (other.com)

URL redirect services aren't a DNS service. They work at the HTTP level rather than the DNS level. Some DNS providers bundle a URL redirect service as part of their overall offering. This service isn't currently supported by Azure DNS.

The URL redirect feature is tracked in the Azure DNS backlog. Use the feedback site to register your support for this feature.

Please refer : https://docs.microsoft.com/en-us/azure/dns/dns-faq#does-azure-dns-support-url-redirects

Kindly let us know if you need any further assistance on this issue from our end.


Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.


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.

AndyDaSilva52 avatar image
0 Votes"
AndyDaSilva52 answered

I recommend to take a look at the documentation at the link below

https://docs.microsoft.com/en-us/azure/frontdoor/front-door-url-redirect

@GitaraniSharmaMSFT-4262 is trying to say that some DNS services provides features to do the redirect, but this is not rule.

There is the Azure Front Door Service that could be the right choice to make a Redirect URL

https://docs.microsoft.com/pt-br/azure/frontdoor/front-door-overview

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.

GitaraniSharmaMSFT-4262 avatar image
0 Votes"
GitaraniSharmaMSFT-4262 answered JasonH-7169 published

Hello PaulMckenna-7202 ,

You can use Azure DNS alias records to access the website without prepending "www" to your DNS name.
An alias record set is supported for the following record types in an Azure DNS zone:
- A
- AAAA
- CNAME

For example, if your website is named www.contoso.com, your users can access your site using contoso.com without the need to prepend www to the DNS name.

Please refer : https://docs.microsoft.com/en-us/azure/dns/dns-alias

Kindly let us know if you need any further assistance on this issue from our end.


Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.

· 7
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.

Hi there, thanks for getting back to me.

I understand what you have suggested, however that is not what I need to do. I have read the documentation provided and a lot of issues on the forums, none of which address my concern.

I need to create a CNAME record so the eg contoso.com points to another website. I have chatted with your support and they said to post here for a DNS specialist to solve this issue.

I hoped to make the situation as clear as possible in my original message so please refer to that and let me know if you have any questions.

0 Votes 0 ·

To be clear, I need eg contoso.com to point to a website, an IP address is not a possible solution as the IP is not static

0 Votes 0 ·

Hello @PaulMckenna-7202 ,

Thank you for your update.

I believe you are looking for something like 301 (Permanent) redirect service for apex (naked) domains.
For e.g:
(1) The root domain (example.com) should 301 (permanent) redirect to the www CNAME (www.example.com)
(2) The www CNAME (www.example.com) should direct to the external website (other.com)

URL redirect services aren't a DNS service. They work at the HTTP level rather than the DNS level. Some DNS providers bundle a URL redirect service as part of their overall offering. This service isn't currently supported by Azure DNS.

The URL redirect feature is tracked in the Azure DNS backlog. Use the feedback site to register your support for this feature.

Please refer : https://docs.microsoft.com/en-us/azure/dns/dns-faq#does-azure-dns-support-url-redirects

Thanks,
Gita


0 Votes 0 ·
Show more comments

@PaulMckenna-7202 did you ever figure out a solution for this? I'm up against the same problem and its quite ridiculous that you cant set a CNAME record with @

0 Votes 0 ·