All Projects → h46incon → Aliddnsbash

h46incon / Aliddnsbash

Licence: mit
阿里云域名解析动态更新(DDNS)的 Shell 脚本

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Aliddnsbash

Ddns Scripts aliyun
OpenWrt/LEDE DDNS support for aliyun (阿里云)
Stars: ✭ 224 (+29.48%)
Mutual labels:  aliyun, openwrt
Sharealiddns
全功能阿里云域名解析脚本(支持IPV4, IPV6, 多域名等,同时支持asuswrt-merlin 、padavan、pandorabox、lede/openwrt固件)
Stars: ✭ 280 (+61.85%)
Mutual labels:  aliyun, openwrt
Aliddns
aliyun ddns for golang【阿里云DDNS服务,用来将自己的动态IP同步到自己的域名解析服务器,安装方便,配置简单,默认支持Linux和MacOS以后台服务方式持续运行】
Stars: ✭ 136 (-21.39%)
Mutual labels:  aliyun, openwrt
Spring Boot Quick
🌿 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等📌
Stars: ✭ 1,819 (+951.45%)
Mutual labels:  aliyun
Aliyun Ddns
阿里云动态域名工具,支持docker和ipv6。
Stars: ✭ 131 (-24.28%)
Mutual labels:  aliyun
Aliyun Ons
☁️ SDK of Node.js for Aliyun ONS. 🚀
Stars: ✭ 151 (-12.72%)
Mutual labels:  aliyun
Netjson
NetJSON is a data interchange format for encoding the basic building blocks of networks.
Stars: ✭ 171 (-1.16%)
Mutual labels:  openwrt
Hybrid multicloud overlay
MutiCloud_Overlay demonstrates a use case of overlay over one or more clouds such as AWS, Azure, GCP, OCI, Alibaba and a vSphere private infrastructure in Hub and spoke topology, point to point topology and in a Single cloud. Overlay protocols IPv6 and IPv4 are independent of underlying infrastructure. This solution can be integrated with encryption and additional security features.
Stars: ✭ 127 (-26.59%)
Mutual labels:  aliyun
Openwrt
Mercer's OpenWrt source tree
Stars: ✭ 158 (-8.67%)
Mutual labels:  openwrt
Alispot
自动创建阿里云抢占式实例,并启用网络加速
Stars: ✭ 139 (-19.65%)
Mutual labels:  aliyun
Openwrt Shadowsocksr
ShadowsocksR-libev for OpenWrt/LEDE
Stars: ✭ 136 (-21.39%)
Mutual labels:  openwrt
Aliyun Emapreduce Datasources
Extended datasource support for Spark/Hadoop on Aliyun E-MapReduce.
Stars: ✭ 132 (-23.7%)
Mutual labels:  aliyun
Openwrt Rpi
Raspberry Pi & NanoPi R2S/R4S & G-Dock & x86 OpenWrt Compile Project. (Based on Github Action / Daily Update)
Stars: ✭ 3,492 (+1918.5%)
Mutual labels:  openwrt
Easy Build
Collection of Dockerfiles for building embedded software distributions
Stars: ✭ 130 (-24.86%)
Mutual labels:  openwrt
Libumqtt
A Lightweight and fully asynchronous MQTT client C library based on libev
Stars: ✭ 163 (-5.78%)
Mutual labels:  openwrt
Gateway Go
🎁GateWay Client for OpenIoTHub[云易连访问内网端口和设备的网关]
Stars: ✭ 127 (-26.59%)
Mutual labels:  openwrt
Openapi Core Nodejs Sdk
OpenAPI POP core SDK for Node.js
Stars: ✭ 156 (-9.83%)
Mutual labels:  aliyun
Openwrt
Lienol's Modified OpenWrt source
Stars: ✭ 2,153 (+1144.51%)
Mutual labels:  openwrt
Xluci2
DEPRECATED. xLuCI2 is a JavaScript Webgui for embedded devices running OpenWRT or LEDE
Stars: ✭ 148 (-14.45%)
Mutual labels:  openwrt
Docker
Mirror of https://gitlab.com/openwrt/docker. Please use merge requests and issues at GitLab rather than here.
Stars: ✭ 173 (+0%)
Mutual labels:  openwrt

AliDDNSBash

介绍

如果使用了阿里云(万网)的域名解析服务的话,那么就可以通过它提供的API,使用HTTP访问动态修改解析地址,以实现DDNS的功能。阿里云也提供了一些语言的SDK,但是并没有Shell版本的。

所以只能自力更生,写了一个Shell脚本来访问API。

注意:此脚本只实现了调用修改域名解析记录获取解析记录列表的API的功能,并没有完整实现整个SDK。但是因为脚本已经实现了API的签名机制,所以很容易实现其他API的调用。

本脚本在OpenWRT中测试通过。(也就是在这种场合会连个Python都跑不了,而一定要使用Shell…)

参考:阿里云解析API文档

功能

  • 能在 OpenWRT 上原生的 ash 中执行。
  • 仅在当前IP地址和域名解析设置不同时,发起更新请求。(本机当前IP地址通过3322.org提供的API 进行查询,域名的解析设置通过API:DescribeDomainRecordInfo 查询。)
  • 还没在脚本中分析API执行的结果,只是单纯打印出来。

使用方法

  1. 安装依赖

首先需要一个shell(目标是支持所有符合 POSIX 标准的 shell,在 ashbash 上测试通过)。

然后安装curlopenssl-util。这些软件包在OpenWRT下可直接使用 opkg 命令安装。

  1. 修改脚本的setting代码段,其中DomainRecordId不清楚的话暂时不用修改,DNSServer修改为你在万网上使用的DNS服务器。如:
AccessKeyId="MyID"
AccessKeySec="MySecret"
DomainRecordId="00000"
DomainRR="www"
DomainName="example.com"
DomainType="A"
DNSServer="dns9.hichina.com"
  1. 如果不清楚DomainRecordId的话,修改main函数,在里面调用describe_record,如:
	main()
	{
		describe_record
		#update_record
	}

然后执行这个脚本。如果没问题的话,就能获取到域名的所有解析记录的列表了:

{"PageNumber":1,"TotalCount":1,"PageSize":1,"RequestId":"0000","DomainRecords":
  {"Record":[{"RR":"www","Status":"ENABLE","Value":"8.8.8.8",
  "RecordId":"21332133","Type":"A","DomainName":"example.com",
  "Locked":false,"Line":"default","TTL":"600"},]}
  }HttpCode:200

上面的结果中,RecordId为21332133。得到结果后再修改DomainRecordId为正确的值。

  1. 修改main函数:
	main()
	{
		#describe_record
		update_record
	}

执行脚本即可。脚本会在本机IP地址和当前域名解析设置不同的时候调用API更新设置。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].