RouterOS的IPv6 DDNS自用脚本
2025-09-23 10:01:49
使用cloudflare托管域名
获取dnsid,ZONEID,TOKEN 使用你自己的即可 toekn只需要dns权限即可
curl --request GET \
--url "https://api.cloudflare.com/client/v4/zones/ZONEID/dns_records?type=AAAA&name=xxx.xxx.com" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer TOKEN"
这个脚本必须命名为”ddns” 因为它会把之前的IP存在COMMENT注释里
1 | :local token ""; |
先运行一次,可以看到更新成功了,再运行一次没反应,说明从Comment里读到IP并认为相同,不需要更新。
参考 https://velaciela.ms/routeros-using-cloudflare-update-ddns-ipv6-only