关于CloudFlare workers绑定域名这件事
前言
事情是这样的,在某一天我突然发现我的cf worker绑定不上自己的域名了,我按照之前的操作在worker里添加域名,然后在dns界面将域名指向1.1.1.1,访问域名就会出现什么无法连接啊之类的错误,我之前一直以为是cf在国内的延迟问题,一定等一段时间就好了吧!然后过了很久很久依旧是无法访问。但我之前绑定的域名都正常,我开始怀疑 难道这家美国慈善互联网公司把这项重要功能改成收费了嚒?!我去网上查,但只能查到一些两三年前的文章,去cf的blog,奈何英语不怎么样没发现一个所以然,然鹅就在刚刚,我下定决心解决这个问题,并且在worker--路由
旁发现有一个指引,然后一划就看到了官方解释...
正文
Subdomains must have a DNS Record
All subdomains must have a DNS recordOpen external link to be proxied on Cloudflare and used to invoke a Worker. For example, if you want to put a worker on myname.example.com, and you have added example.com to Cloudflare but have not added any DNS records for myname.example.com, any request to myname.example.com will result in the error ERR_NAME_NOT_RESOLVED.
To support this, you should use the Cloudflare dashboard to add an AAAA record for myname to example.com, pointing to 100:: (the reserved IPv6 discard prefixOpen external link).
一句话说就是需要把域名导向AAAA
的100::
就可以正常使用了
我* 赶紧去试试,成功将自己的域名绑定,并正常访问,既然域名不能导向1.1.1.1
了,那为什么我之前导向1.1.1.1
的域名还可以访问啊喂!!!!!
我感觉我是个憨批,但是我觉得世界上憨批应该不止我一个(,所以我决定发出来 尽管没多少人看233