Redirect @ to www in Azure DNS

Paul Mckenna 6 Reputation points
2020-08-11T09:51:22.633+00:00

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
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
396 questions
No comments
{count} votes

4 answers

Sort by: Most helpful
  1. GitaraniSharma-MSFT 27,411 Reputation points Microsoft Employee
    2020-08-17T08:59:48.017+00:00

    Hello @Paul Mckenna ,

    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://learn.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.

    No comments

  2. Jay Kim 11 Reputation points
    2021-05-25T23:46:52.86+00:00

    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

  3. GitaraniSharma-MSFT 27,411 Reputation points Microsoft Employee
    2020-08-11T10:20:27.093+00:00

    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://learn.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.


  4. AndyDaSilva52 1 Reputation point
    2021-08-21T13:10:32.23+00:00

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

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

    @GitaraniSharma-MSFT 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://learn.microsoft.com/pt-br/azure/frontdoor/front-door-overview

    No comments