当前位置:论坛首页 > Linux面板 > 讨论

linux 系统通过添加域名动态解析功能实现adsl架站

发表在 Linux面板2017-9-11 19:54 [复制链接] 1 2010

本帖最后由 天龙山人 于 2017-9-11 19:57 编辑

1. 下载脚本

cloudxns:

wget https://raw.githubusercontent.com/xdtianyu/scripts/master/ddns/cloudxns.shwget https://raw.githubusercontent.com/xdtianyu/scripts/master/ddns/cloudxns.confchmod +x cloudxns.sh

dnspod:

wget https://raw.githubusercontent.com/xdtianyu/scripts/master/ddns/dnspod.sh
wget https://raw.githubusercontent.com/xdtianyu/scripts/master/ddns/dnspod.conf
chmod +x dnspod.sh

2. 配置

cloudxns:

API_KEY="YOUR_API_KEY"SECRET_KEY="YOUR_SECRET_KEY"DOMAIN="example.com"HOST="ddns"LAST_IP_FILE="/tmp/.LAST_IP"

dnspod:

ACCOUNT="xxxxxx@gmail.com"PASSWORD="xxxxxxxxxx"DOMAIN="xxxx.xxx.org"RECORD_LINE="默认"

3. 运行测试

dnspod: ./dnspod.sh dnspod.conf

cloudxns: ./cloudxns.sh cloudxns.conf

4. 添加到 cron 定时任务

/etc/init.d/cron enablecrontab -e

添加如下内容,注意修改路径

cloudxns:

*/3 * * * * /root/ddns/cloudxns.sh /root/ddns/cloudxns.conf >> /root/ddns/cloudxns.log

dnspod:

*/3 * * * * /root/ddns/dnspod.sh /root/ddns/dnspod.conf >> /root/ddns/dnspod.log


使用道具 举报 只看该作者 回复
发表于 2017-9-13 23:39:27 | 显示全部楼层
这个要收藏
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表