ddns
Contents
cloudflare
config zone-key
具体配置可以参考如下链接
api
api tutor 这篇教程详细介绍了cloudflare域名相关api。有了这个背景,就方便调试openwrt 的ddns服务了。 其原理就是,先根据api查询域名对应的记录。之后在发现ip变更后,更新该域名对应的记录即可。
zone key
| |
zoneID
| |
recordID
- -RecordID-
| |
update record
| |
openwrt config
config 按照下图配置即可, 用户名 (Bearer)、 密码 (Zone-key)都是固定的填写方式。 看教程还有使用 email 和 global-key ,但我自己测试没有成功

issue
/usr/lib/ddns/update_cloudflare_com_v4.sh 安照上述配置后,若是请求还报错,在openwrt中查看具体的日志。如: Invalid format for X-Auth-Key header, 根据具体情况处理。我遇到的错误是需要在openwrt上修改其脚本,设置zone_id变量, zone_id由上面的api获得.
修改如下图。

docs
- https://blog.hellowood.dev/posts/openwrt-ddns-%E9%85%8D%E7%BD%AE%2f
- https://keesenz.com/2020/1067.html
- https://blog.crstian.me/en/post/2022-01-19-openwrt-ddns/
- https://forum.openwrt.org/t/trying-cloudflare-ddns-on-21-02/102365
- https://github.com/ddclient/ddclient/issues/262
- https://stackoverflow.com/questions/46514412/traefik-lets-encrypt-cloudflare-6103-invalid-format-for-x-auth-key-header
- https://alexskra.com/blog/dynamc-dnsddns-with-openwrt-and-cloudflare/
- https://dynv6.com/zones/4178344/instructions
