Coder Social home page Coder Social logo

aliddns's Introduction

AliDDNS

阿里云域名DDNS自动配置。路由器或者连接路由器的任一电脑运行此脚本均可。

使用方法

1.安装python和pip

sudo apt install python3 python3-pip

2.安装阿里云sdk

pip3 install aliyun-python-sdk-alidns

3.申请阿里云AccessKey

https://ak-console.aliyun.com/#/accesskey 申请即可,<key>参数对应AccessKeyId,<secret>对应AccessKeySecret

4.使用方法

查看使用说明
python3 aliddns.py --help
自动更新域名IP
python3 aliddns.py [-h] [--ipv6] <key> <secret> <rr> <domain>
必选参数:
key         从https://ak-console.aliyun.com/#/accesskey得到的AccessKeyId
secret      从https://ak-console.aliyun.com/#/accesskey得到的AccessKeySecret
rr          例子:@, *, www, ...
domain      例子: aliyun.com, baidu.com, google.com, ...
可选参数:
--ipv6      使用本机的ipv6地址
例子
python aliddns.py ABDGDJSKN QWERTYUIOPASDG pan baidu.com
python aliddns.py ABDGDJSKN QWERTYUIOPASDG pan baidu.com --ipv6

5.crontab定时执行

crontab -e
文件末尾添加一行,功能:每5分钟执行一次
*/5 * * * * python3 /home/xxx/aliddns.py ABDGDJSKN QWERTYUIOPASDG pan baidu.com > /dev/null
是否成功设置,请在阿里云手动修改后,观察是否自动修改

参考项目

mgsky1/DDNS

aliddns's People

Contributors

quancs avatar alice-space avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.