Search code examples
azureazure-dns

Azure DNS Zone www CNANE pointing to Azure Static Web Application not working without www


I have an Azure DNS Zone, which has the @ (NS and SOA) as per Azure default configuration.

Then a www CNAME records pointing to an Azure Static Web Application.

This CNAME record works perfect when browsing www.domain.com but it does not serve when browsing domain.com

I've read at Microsoft that, by default, all traffic to domain.com will be redirected to www.domain.com but it is not working in my case.

I tried adding *.domain.com pointing to www.domain.com and even to the Azure static app value (xxxxxxx.azurestaticapps.net) but still have no luck.

Should I define a specific record for domain.com to work properly?

Thanks.


Solution

  • Yes, you need to create DNS resource records for domain.com. Delete *.domain.com.

    • Name: @
    • Type: A - Alias to IPv4 address
    • Alias: Yes
    • Alias Type: select Azure resource

    Set up an apex domain with Azure DNS in Azure Static Web Apps