4

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

DNS showing in CloudFlare

  • investigating serverfault.com/questions/718503/… – kirsten g Jun 25 '17 at 5:34
  • 1
    What exactly are you trying to achieve? A 5 second look at that documentation (may have been less) suggests you need a CNAME for the www subdomain pointing at Azure using the Azure domain name. – Tim Jun 25 '17 at 7:17
  • 1
    awverify is only needed for validation before moving www. The TXT doesn't make any sense: is it just a test of which RR allows this syntax, because CNAME is not allowed for @ (for a good reason). – Esa Jokinen Jun 25 '17 at 8:35
  • @EsaJokinen The TXT record is required at configuration time. – kirsten g Jun 25 '17 at 22:23
  • 1
    The instructions seem fairly comprehensive. Maybe a screenshot of your DNS settings would help, along with a screenshot of the DNS part of your azure app. The main problem here is we're having to drag information out of you, try to add as much information as you can before the question is closed for being too broad. – Tim Jun 26 '17 at 3:01
10

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:

  1. Disable CloudFlare's HTTP proxying (click the orange cloud on that CNAME record so that it turns grey); this also disables CNAME flattening for that record.
  2. Check your host on dig until you see the CNAME records show up.
  3. Verify your CNAME host on the Azure portal.
  4. Re-enable CloudFlare's HTTP proxying (click the grey cloud on that CNAME record so it turns orange).

This allows you to verify on Azure and still take advantage of CloudFlare's CDN.

  • Fixed the problem for me, fast and easy! – McGuireV10 Dec 15 '17 at 11:55
  • I also found that if I had the DNS set up correctly with another provider then I could import it correctly before changing the name server. – kirsten g Jan 5 '18 at 21:12
0

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.

c:\> nslookup
> set type=CNAME
> www.mywebsite.net.au

and compare the results with:

c:\> nslookup - 123.123.123.123  <- replace with cloudflare dns server
> set type=CNAME
> www.mywebsite.net.au

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:

awverify CNAME awverify.myapp.azurewebsites.net

This was a requirement to validate the domain before using it. You can delete after verification.

  • by my ISP do you mean Azure? or my Domain Name Registrar? – kirsten g Jun 26 '17 at 5:19
  • nslookup reports the primary name server is at cloudflare – kirsten g Jun 26 '17 at 5:20
  • but what about the CNAME entry? can you see it? You just need to change the filter to CNAME in the console and query the FQDN of your site. – Bruno Faria Jun 26 '17 at 23:16
  • I set type=CNAME as you instructed the information that was returned did not include the word CNAME. mywebsite.net.au primary name server = myserver.ns.cloudflare.com responsible mail addr = dns.cloudflare.com other properties such as serial, refresh, retry, expire and default TTL were also listed. – kirsten g Jun 27 '17 at 3:56
  • could you provide the domain name that you are trying to setup in Azure for me to check? – Bruno Faria Jun 27 '17 at 8:32
-1

In CloudFlare DNS I have

Type Name Value
CNAME www        is an alias of myapp.azurewebsites.net

Please modify www to your hostname in Cloudflare management page, like this:

CNAME     jasontest321       jasontest321.azurewebsites.net

It works for me:enter image description here

  • It's supposed to work with any alias, not only the hostname of the application. – Bruno Faria Jun 26 '17 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.