Skip to content

eightpigs/aliyun-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aliyun-DDNS

获取当前公网IP并动态修改阿里云DNS。

Related: eightpigs/ddns-scripts-alidns

使用

请阅读 example config.yaml

运行

pip3 install -r requirements.txt
# 可指定配置文件路径
python3 ./aliyun-ddns.py [~/.config/ddns-config.yaml]

运行结果

------------------ Aliyun DDNS ------------------
-------------- 2021-01-01 01:01:01 --------------
-------------------------------------------------

=> Config path:
   ./config.yaml

=> IP: 111.111.111.111

=> Domain: aliyun.com
     - [Skip] www
   Update:
     - [True] @
     - [True] api
   Add:
     - [True] console
     - [True] dns.console
     - [False] ecs.console

=> Domain: baidu.com
   ...

=> Domain: qq.com
   ...
-------------------------------------------------

定时运行

如果IP频繁变更,则可以加入Cron Job中

crontab -e
# 例如,每隔4小时运行一次
# 0 */4 * * * python3 aliyun-ddns.py > /var/log/aliyun-ddns.log