梅林固件使用Cloudflare的DDNS服务

梅林固件使用Cloudflare的DDNS服务

记忆の风
2022-05-19 / 0 评论 / 81 阅读 / 正在检测是否收录...

固件自带的DDNS服务里面没有Cloudflare。但是在软件中心里面有这个插件来实现,它就是cfddns插件。

cfddns

简介
这是一个适用于梅林固件(koolshare) 的 CloudFlare DDNS 插件,基于 gdddns 修改而来

插件使用
固件版本为 380.70-X7.9.1 的,请使用 cfddns 1.1.1 版本

固件版本低于 380.70-X7.9.1 的,请使用 cfddns 1.0.0 版本

CloudFlare参数列表

**参数名** **示例** **备注**
API Key c2547eb745079dac9320b638f5e225cf483cc5cfdda41 Global API Key
Email [email protected] 账户邮箱
Zone ID 023e105f4ecef8ad9ca31a8372d0c353 域名ID
Record ID 372e67954025e0ba6aaa6d586b9e0b59 DNS记录ID

使用 cURL 获取 Zone ID

curl -X GET "https://api.cloudflare.com/client/v4/zones" -H "Content-Type: application/json" -H "X-Auth-Key: $API_KEY" \ -H "X-Auth-Email: $EMAIL"

响应中的 id 即为 Zone ID

{"result": [{"id": "023e105f4ecef8ad9ca31a8372d0c353", //Zone ID }], //......}

使用 cURL 获取 DNS Record ID

curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \ -H "Content-Type: application/json" \ -H "X-Auth-Key:$API_KEY" \ -H "X-Auth-Email:$EMAIL"

在响应中找到目标域名对应的 id

{ "result": [{ "id": "$RECORD_ID1", "zone_id": "$ZONE_ID", "zone_name": "$example.com", "name": "test1.example.com", // 具体域名1
"type": "A", //......
}, { "id": "$RECORD_ID2", "zone_id": "$ZONE_ID", "zone_name": "$example.com", "name": "test2.example.com", // 具体域名2
"type": "A",
}] //...... }

以上就是这个软件作者的使用说明,如果在软件中心没有的话,也可以下载之后离线安装。

已知问题是路由器重启以后必须进软件中心把插件关闭再打开才能更新新的地址,所以M学院在测试后也决定不使用路由器的DDNS了,用内网群晖的DDNS来实现动态。

附上Github链接地址:https://github.com/geek5nan/koolshare-cfddns

文章摘自http://tech.mornlong.com/post/29.html

0

评论 (0)

取消