While Cloudflare CDN's performance within mainland China leaves much to be desired, it remains highly capable for serving content to international audiences. However, Cloudflare phased out the traditional CNAME setup method some time ago. This article focuses on achieving a similar outcome using SaaS (SSL for SaaS) integration, which requires a credit card for activation.
Prerequisites
- A valid credit card (with card number, security code) or a linked PayPal account. Note: You will not be charged if you stay under the 100 custom hostname limit.
- A Fallback Origin Domain – this must be different from your primary domain that visitors use to access your site (a requirement for Cloudflare setup).
- Your Primary Domain (the domain your visitors use).
To implement separate DNS resolution for mainland China and other regions, the primary domain used for normal access should not be added to Cloudflare directly via the usual "Add a Site" method.
In this guide, the primary domain is: www.iyoroy.cn, and the fallback domain is: nekonya.cloud.
Process
Adding the Fallback Domain to Cloudflare
Register a Cloudflare account and follow the standard procedure to change your domain's nameservers to Cloudflare's:

Select the Free plan:

Update your domain's nameservers at your registrar as instructed:

Wait for the nameserver changes to propagate. You can then manage the fallback domain's DNS through Cloudflare.
Adding Payment Method & Enabling SaaS
Inside the Cloudflare dashboard for your fallback domain, navigate to SSL/TLS -> Custom Hostnames. Click Enable Cloudflare for SaaS:

Enter your credit card information and save it. Then, proceed to activate the SaaS plan:

Creating DNS Record for Fallback Origin & Setting up Custom Hostnames
Go to DNS -> Records in your fallback domain's dashboard. Create a new record pointing to your origin server:
Here, my fallback origin is cname.nekonya.cloud, using a CNAME record (A or AAAA records are also perfectly valid). Ensure the orange-cloud proxy is enabled to utilize Cloudflare's CDN.
Next, go back to SSL/TLS -> Custom Hostnames. In the Fallback Origin field, enter the record you just created (e.g., cname.nekonya.cloud):

Click Add Custom Hostname and enter your primary domain that visitors will use:
The TXT record method is recommended for Domain Control Validation (DCV), as it allows for DCV Delegation (see the next section).
You will now need to verify ownership by adding the provided TXT record(s) to your primary domain's DNS (this example shows a test record for demonstration, as the actual one was already configured):
Because we will use DCV delegation for ongoing certificate validation in the next step, do not add the specific certificate validation records here yet. If you were not using DCV delegation, you would add those records now.
Once the hostname status changes to Active, you can safely remove the temporary TXT (and potentially CNAME) record(s) you added for the initial verification.
Setting up DCV Delegation
Locate the DCV Delegation for Custom Hostnamessection further down the same page. Copy the provided CNAME value. Go to your primary domain's DNS management console and add a new CNAME record.
- Hostname:
_acme-challenge.www(This depends on your primary domain. Forwww.iyoroy.cn, it's_acme-challenge.www. Fortest.iyoroy.cn, it would be_acme-challenge.test). - Value: The value provided by Cloudflare, prefixed with your hostname (e.g.,
www.iyoroy.cn.xxxxxxxx.dcv.cloudflare.com).
Configuring CNAME Record for Traffic Routing
In your primary domain's DNS management console, add a CNAME record for the subdomain you are using (e.g., www). Configure your DNS provider's Geolocation or Split DNS features to ensure that:
- Traffic from outside mainland China resolves to the Fallback Origin you set in Cloudflare (e.g.,
cname.nekonya.cloud).
If everything is configured correctly, you should see both the Certificate Status and Hostname Status as Active in the Custom Hostnames section:

Testing confirms that traffic from outside China is now routed through Cloudflare:

The DNS management system used in this article is netcccyun/dnsmgr
吃瓜🍉
[...]该文章写于 2025-07-08 不保证任何时候都有效!!!这是 .top 域名的测试结果可以看到解析结果有很大一部分是 x.x.x.1 这样子的IP地址,这些在中国大陆无法被访问解决方法1.SaaS 优选这个方法在网上已经有很多教程了,诸位可以自行搜索例如: CloudFlare for SaaS 官方免费CNAME接入/自定义节点(CF自选IP)教程为博客启用Cloudflare SaaS接入[...]
我配置后,访问辅助域名,https协议,525 SSL handshake failed 错误;http协议,跳转到阿里云界面,显示"域名暂时无法访问…该域名当前备案状态不符合访问要求",我辅助域名是Namecheap购买的。必须要备案才能实现分流吗?
辅助域名不需要备案,辅助域名只是用于回源,实际访问是主域名
这么好的聚合DNS管理为什么不推荐一下