For CentOS:

yum install -y wget curl cronie

For Debian 8+:

apt install -y wget curl cron

For Ubuntu/Debian 7:

apt-get install -y wget curl cron

然后下载AliDDNS脚本到你的服务器上:

wget -O /usr/sbin/AliDDNS-v2.0.sh https://ilemonrain.com/download/shell/AliDDNSv2.sh

为脚本文件加上可执行属性:

chmod +x /usr/sbin/AliDDNS-v2.0.sh

执行脚本,开始配置:

/usr/sbin/AliDDNS-v2.0.sh

如果需要配置的域名是域名为ddns.example.com
那么第一次一级域名输入example.com
第二次二级域名输入ddns

Crontab (定时任务):

crontab -e

添加如下定时任务:

*/1 * * * * /usr/sbin/AliDDNS-v2.0.sh run >/dev/null 2>&1 &

重启crontab:
For CentOS:

service crond restart

For Ubuntu/Debian:

service cron restart

并将Cron加入开机启动项:
For CentOS:

chkconfig crond on

For Ubuntu/Debian:

systemctl enable cron

已有 2 条评论

  1. 新春快乐哈~

添加新评论