golang 基于阿里云DNS接口实现外网IP自动解析
By S.F.
本文链接 https://www.kyfws.com/post/aliyun-dns-go/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 1 分钟阅读 - 253 个词 阅读量 0首先,你是阿里云的域名用户,通过备案和获取了API的AccessKey。
Key | value |
---|---|
AccessKey ID | 申请获取 |
AccessKey Secret | 申请获取 |
Documents
Aliyun SDK API Docs Github Docs API Explorer for DNS Regions & Endpoints
Alibaba-cloud-sdk for golang
云解析 DNS
最新版本:v1.61.487 最后更新:2020-09-11 11:24:55 依赖链接:https://github.com/aliyun/alibaba-cloud-sdk-go/tree/master/services/alidns
go get github.com/aliyun/alibaba-cloud-sdk-go/tree/master/services/alidns
自动更新思路
1.命令行参数设计
参数名 | 用法 |
---|---|
domain | dns1.domain.com,dns2.domain.com… |
Timetask | 10 minute |
2.Task flow
- Resolve the WLAN IP of the home network
- Check and compare the results of domain name DNS resolution IP
- If the WLAN IP is different, update the aliyun DNS IP to WLAN IP
- Wait for the default 10 minutes to continue the task