Azure网站添加子域名时无法验证域名所有权问题咨询
Hey there! Let’s work through this problem together—since your root domain is already accessible, we know the foundational setup is solid, so let’s zero in on why the www subdomain verification is failing even after adding the CNAME in Cloudflare. Here are the most common fixes to check:
1. Double-Check Your Cloudflare CNAME Record Details
First, make sure your CNAME entry in Cloudflare is configured correctly:
- Hostname: It should be just
www(notwww.yourdomain.comor any full domain string). - Target: Copy-paste the exact CNAME target provided by Azure (usually in the format
<your-app-service-name>.azurewebsites.net). Even a tiny typo (like missing a character or extra dot) will break verification. - Proxy Status: This is the most frequent culprit! If Cloudflare’s orange cloud (proxy mode) is enabled for this record, Azure can’t resolve the true CNAME value because Cloudflare masks it with its own proxy IP. Switch this to DNS Only (gray cloud) temporarily, complete the Azure verification, then you can switch back to proxy mode afterward.
2. Verify the CNAME Record is Propagated
Before retrying in Azure, confirm the record is live across DNS servers:
- Use command-line tools to check:
- Run
nslookup www.yourdomain.comand look for the CNAME entry matching your Azure app service domain. - Or use
dig www.yourdomain.com CNAMEfor more detailed DNS info.
- Run
- If the record doesn’t show up, wait for DNS propagation (TTL settings can cause delays—usually 5-15 minutes, but sometimes longer). You can also clear your local DNS cache (e.g.,
ipconfig /flushdnson Windows,sudo dscacheutil -flushcacheon macOS) to test immediately.
3. Confirm Azure’s Verification Setup
Make sure you’re following the right steps in Azure:
- On the App Service’s Custom Domains page, select Add custom domain, enter
www.yourdomain.com, and choose CNAME as the record type (don’t accidentally pick A record, which is for root domains). - If you’ve tried verifying this domain before, delete any failed attempts from Azure’s domain list first, then restart the verification process.
4. Rule Out Cloudflare Interference
Check for other Cloudflare settings that might block verification:
- Temporarily disable any Page Rules or Redirect Rules that target the www subdomain (e.g., auto-redirects to the root domain). These can interfere with Azure’s ability to validate the record.
- Confirm your domain’s name servers are fully pointing to Cloudflare—if you’re using a mix of Cloudflare and other DNS providers, records might not sync correctly.
Once you’ve checked these points, retry the verification in Azure. In most cases, disabling Cloudflare’s proxy for the www record temporarily will resolve the issue.
内容的提问来源于stack exchange,提问作者Cami Rodriguez

