安装DDNS
- 安装pip:
apt install python-pip
- 安装ddns:
pip install ddns
配置DDNS
- 编辑配置文件:
vim config.json
{
"$schema": "https://ddns.newfuture.cc/schema/v2.8.json",
"debug": false,
"dns": "cloudflare",
"id": "",
"index4": "public",
"index6": "default",
"ipv4": ["xx.xx.com"],
"ipv6": [],
"proxy": null,
"token": "*",
"ttl": null
}
- 运行DDNS:
ddns
出现以下输出即为成功:(如果没有输出即ip没有改变)
xx.xx.com(A) ==> xx.xx.xx.xx [via DIRECT]
设置定时任务(自动更新)
- 下载项目:
git clone https://github.com/NewFuture/DDNS.git
cd DDNS
- 复制配置文件的
config.json
到DDNS目录下:
cp /root/config.json /root/DDNS/config.json
- 运行脚本(自动配置定时任务):
bash task.sh
- 查看日志:(出现
xx.xx.com(A) ==> xx.xx.xx.xx [via DIRECT]
即修改dns成功)
cat run.log
完成!
参考链接
https://github.com/NewFuture/DDNS
此处评论已关闭