aliyun-ddns-updater
v1.0.1
Published
A DDNS client for Aliyun's DNS service.
Downloads
9
Readme
Aliyun DDNS Updater
A DDNS client for Aliyun's DNS service. It will look for the device's public IP addresses and update the DNS record with Aliyun's API.
Usage
Install:
npm install -g aliyun-ddns-updater
Then run:
DOMAIN=example.com \
SUB_DOMAIN=ddns \
AK_ID=(accessKeyId) \
AK_SECRET=(accessKeySecret) \
CRON="0 * * * *" \
aliyun-ddns-updater
Or, with Docker:
docker run -d \
--name aliyun-ddns-updater \
-e DOMAIN=example.com \
-e SUB_DOMAIN=ddns \
-e AK_ID=(accessKeyId) \
-e AK_SECRET=(accessKeySecret) \
-e CRON="0 * * * *" \
--restart unless-stopped \
hehongbo/aliyun-ddns-updater
The application will look for IP addresses through a public lookup service (by default is https://bot.whatismyipaddress.com
), so you don't need to create the container with a host network.
More Options
- IPv6?
Yes, with environment variableUPDATE_V6
set toENABLED
, orONLY
if you are using a single v6 stack and updates onlyAAAA
record. - Update top-level record?
Just leave theSUB_DOMAIN
environment variable unset. You don't need to pass an@
to update the top-level record. - Detecting IP address with a different lookup service?
Specify it with anIP_LOOKUP_SERVICE
environment variable. Note that the application expects a plain address without JSON enclosures or statements like "Your IP address is:", and assumes that the entire response body is the address. - One-shot?
Yes, just remove theCRON
environment variable, and it will run only once. That would be helpful if you want to run the application with an external scheduler like Systemd timer. Also, remember to replace the restart policy with something like--rm
if you want to run it with Docker before the Docker engine tries to restart it infinitely forever. - Timezone?
Could be set with aTIMEZONE
environment. That would affect cron expressions with a specified hour or day. The log output's timestamp will also be affected by this. See Moment Timezone for more information.
All Environment variables
| Variable | Required | Description | Default |
|:--------------------|:---------|:----------------------------------------------------------------------------------------------------------|:------------------------------------|
| DOMAIN
| YES | The domain (top-level part) to update. | |
| SUB_DOMAIN
| | The subdomain to update. Leave unset to update the top-level domain. | |
| AK_ID
| YES | Aliyun's accessKeyId. | |
| AK_SECRET
| YES | Aliyun's accessKeySecret. | |
| UPDATE_V6
| | Update the AAAA record with your IPv6 address. Set to ENABLED
if needed, or ONLY
to update only IPv6. | |
| CRON
| | Cron expression to control the timing of update tasks. | |
| TIMEZONE
| | In which timezone should the application executing the cron task. | Etc/UTC
|
| IP_LOOKUP_SERVICE
| | The URL of IP lookup service. | https://bot.whatismyipaddress.com
|
| IP_LOOKUP_TIMEOUT
| | Maximum time to wait (in millisecond) for the lookup service return an IP address. | 3000
|