GoForum › 🌐 V2EX
[3/100]分享一个动态更新本机 ip 到 dns 服务器的脚本
marginleft ·
2026-01-09 22:58 ·
0 次点赞 · 1 条回复
家里的宽带,打电话开通了公网 IP ,所以需要定时更新公网 IP ,防止重启后 dns 记录不更新。因为是托管在 cloudflare 上的域名,没有找到现成的工具,所以自己用 github copilot 写了一个脚本。自己测试了一下,比较符合预期:
./ddns_sync_public_ip.sh --setup-cron
添加到定时任务里面,就不用管了,默认每 5 分钟同步一次。
- github 地址:https://github.com/100apps/ddns_sync_public_ip
- 代码~99%都是 github copilot 生成的,我自己部署的时候,做了一些微调,原始的 prompt 在这里:https://github.com/100apps/ddns_sync_public_ip/pull/1
1 条回复
添加回复
你还需要 登录
后发表回复
https://github.com/qdm12/ddns-updater/tree/master 这个,用了好几年了, 还挺好的