使用Python脚本调用阿里DNS解析API以提供DDNS服务
基于https://ngx.hk/ 作者编写的脚本
(X64版本请使用ngx.hk的镜像 https://hub.docker.com/r/ngxproj/ddns_aliyun/ )
for IPv4: https://ipv4.81pla.cn
for IPv6: https://ipv6.ngx.hk
通过比对本地临时文件的旧IP地址
当IP地址变化时,调用阿里云的pyhton3 SDK 完成IP地址更新
以传参的形式传递必要的内容:
–domain:域名,必填
–subdomain:子域名,必填
–ttl:免费用户最低为600秒,免费用户低于此值时,阿里会回传错误,可选
–ver:网际协议本版,默认为 IPv4,可选
–id:阿里云 API KeyID,必填
–sk:阿里云 API Secret Key,必填
–time:轮询时间,默认为60秒,可选
通过以下命令运行即可:
docker run -itd \
--restart always
--name [container name] \
ngxproj/aliyun_ddns:[tag name] \
--domain=[domain name] \
--subdomain=[subdomain \
--id=xxxx \
--sk=xxxx
docker-compose.yml 文件参考
version: '3.5'
services:
ddns:
image: 81pla/ddns_aliyun:v1.1-single-arm
deploy:
resources:
limits:
memory: 100M
restart_policy:
condition: any
delay: 5s
environment:
TZ: Asia/Shanghai
entrypoint: python -u aliyun_ddns.py
command: [--domain=xxx,--subdomain=xxx,--id=xxx,--sk=xxx]
使用过程中需要帮助,请使用email联系我
Content type
Image
Digest
Size
76 MB
Last updated
over 6 years ago
docker pull 81pla/ddns_aliyun:v1.1-single-arm