小萌博客 - 既是个人原创，又是汇聚分享 - immoe.org - CloudFlare CNAME
type: channel
link: https://www.immoe.org/tag/CloudFlare-CNAME/
items: 域名如何通过CNAME方式接入 Cloudflare平台

域名如何通过CNAME方式接入 Cloudflare平台
type: item
date: 2022-07-12T16:27:00+08:00
description: 全篇转载自 @如有乐享 ，由 小萌 进行编辑，本文仅作存档使用就在2021年11月份左右，CloudFlare Partner 突然发送通知邮件，移除 API 中 zone_set ，这样基本上CFP变成“废物”了We are making an emergency change today that will affect your ability to sign up customers via the Cloudflare Host API. Specifically, the ‘zone_set’ operation for creating partial zones will be disabled today, We apologize for making this urgent breaking change.21年12月份官方才回复：Hey everyone, We know that this has caused pain for many of you, so let me share a bit about why we made this change and what you can do about it. Why the sudden change? We discovered a security vulnerability in the zone_set 3 operation of the Host API. Our only available recourse was to disable the endpoint. We sent an email as a heads up, but couldn’t wait to make the change even though we knew it would likely break many partners existing workflows. What can be done going forward? To re-iterate, the zone_set API will not be re-enabled in any form. The two recommended options are: A) Migrate to using the full_zone_set 20 API to onboard customers. B) Migrate to using the tenant API 28 offered through our updated partner program 21. This API allows you to create partial zones, but requires those zones to be authenticated with TXT records. I hope that you can understand that we didn’t make this decision lightly, and that the security of our customers and platform required us to take action.大概意思是 zone_set 存在安全漏洞，其实大家用过CFP都知道，在CFP添加域名是不验证域名所有权的！相关讨论：https://community.cloudflare.com/t/removal-on-zone-set-from-api官宣是后面会提供替代解决方案，不过貌似一直没有啥消息！如果童鞋执意要使用CFP也有临时方法，可使用Global API Key登录。不过不再支持添加新域名，但老用户域名不影响使用。后面有时间再水一篇！好了，下面进入本文的重点，不借助CFP，不花钱，域名如何通过CNAME接入CF？准备工作Cloudflare账号信用卡或者PayPal一个域名(随便)需要NS方式接入CF（源域名）一个域名(真正要用)要通过CNAME方式接入CF（主机域名）本文演示2个域名如下：源域名：i0lo1o.eu.org （参考历史文章： 人人都可申请拥有的EU.org免费域名 ）回退源：jiketuchuang.i0lo1o.eu.org主机域名：img.jiketuchuang.com基本原理源域名 通过NS方式接入CF，然后配置一个DNS(jiketuchuang.i0lo1o.eu.org )解析到真正的服务器上。最后利用SaaS提供的主机域名方式，将真正使用的域名CNAME到回退源(jiketuchuang.i0lo1o.eu.org )即可。NS接入如果已经有接入的域名可忽略这步！将域名 …