I am trying to set up the urls https://www.mywebsite.net.au and https://mywebsite.net.au to work for my Azure App Service using with Cloudflare.
Where mywebsite represents my web site name.
Currently when I go to this url I get a 404 error.
In Azure, In Custom Domains, when I try to add a host name for www.jobtalk.net.au and click validate I get a Domain Ownership error "No CNAME records were found. Please add a CNAME record pointing to sbdwebapp.azurewebsites.net"
If I try adding a CNAME for www with the value sbdwebapp.azurewebsites.net
I get an error message:
n A, AAAA or CNAME record already exists with that host. (Code: 81053)
I am trying to follow https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-custom-domain#cname
The problem is due to a conflict between CloudFlare's CNAME flattening and Azure's CNAME verification. The CNAME flattening essentially returns A records, which speeds up DNS resolution and is a good idea in general. However, Azure's CNAME verification only verifies CNAME records.
The best workaround I've found is to:
This allows you to verify on Azure and still take advantage of CloudFlare's CDN.
It can take a while before you can see changes made in DNS settings. From what I can see, the setup seems correct and all you have to do now is wait. I never used CloudFlare to manage DNS, but they're known by their strong caching in all of their platforms, and I have to assume a managed DNS works the same way. It also could be a problem with your ISP/Microsoft TTL, not CloudFlare.
One way to verify the configuration is to directly access the DNS server from your workstation using the nslookup command. That way you can match what is the source DNS server and what is the information from your ISP.
and compare the results with:
Usually, Microsoft validates DNS settings directly with the DNS Server where your domain is managed, so it doesn't take long, but I had some odd cases before.
Additionally, although I don't see it in documentation anymore, it was a requirement before to add an alias for the awverify entry, so try to add the following to your dns settings:
This was a requirement to validate the domain before using it. You can delete after verification.
Please modify
www
to your hostname in Cloudflare management page, like this:It works for me: