You're right: Azure DNS does not allow creating a CNAME record at the zone apex (root level, i.e., @
) - however, this is a DNS standard limitation, not just an Azure constraint. This is because a CNAME cannot coexist with other records (like NS or SOA, which are mandatory at the apex of a domain).
There are a few workarounds you might consider:
- Use an ALIAS or ANAME record (Azure's
alias record
)
Azure DNS provides alias records as a workaround. You can point the apex of your domain (@
) to:
- Azure Traffic Manager
- Azure Front Door
- Azure CDN
- Public IP address
- Azure DNS zone record set
Steps:
- In Azure DNS zone, add a new A record at
@
. - Check "Alias record set".
- Select the Azure resource you want to point to.
This behaves like a CNAME but is technically an A or AAAA record, which is allowed at the root.
More at https://learn.microsoft.com/en-us/azure/dns/dns-alias
- Use an external DNS providers that support ANAME or ALIAS
If you're not bound to Azure DNS, consider providers like:
- Cloudflare – uses CNAME flattening
- DNS Made Easy – supports ANAME
- Namecheap – supports ALIAS/ANAME
These let you simulate CNAME-like behavior at the root domain.
- Use redirection for root domain
If your goal is to redirect root domain (e.g., example.com
) to www.example.com
, consider:
- Hosting a simple redirect service on an Azure Web App or CDN.
- Using Azure Front Door or Application Gateway to do the redirection.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin