DDNS scripts for qcloud(tencent cloud)
update DNS record automatically from the server. The record is updated every minute.
Combined with the restart policy of docker, the script keeps running as long as the docker service is active.
- Container runtime(docker, podman, etc.)
- An existing DNS record corresponding to the subdomain in this context(for example, in
www.google.com
, the DOMAIN isgoogle.com
, the SUBDOMAIN iswww
) - The ID of the record defined above. This ID can be retrieved by running
getId.sh
script with the correct env variables set(see below) - Active secret id and secret key that has the correct permission
For a first-time user with a domain already purchased, do the following:
- log in the qcloud console for the domain management
- create a record for this DDNS if not already done. the IP can be randomized as this script will automatically update it
- create a sub-user with Read/Write permission of all the Web resources and get the secret ID and secret key.
- run
getId.sh
with theDOMAIN
,SECRET_ID
andSECRET_KEY
set through the env variables - find the id of the record of interest from the output of the previous step and write it down as
RECORD_ID
The following steps must be run every time this container is manually started:
- run
docker run -e RECORD_ID=<RECORD_ID> -e DOMAIN=<DOMAIN> -e SUBDOMAIN=<SUBDOMAIN> -e SECRET_ID=<SECRET_ID> -e SECRET_KEY=<SECRET_KEY> -d --restart always --name ddns onichandame/qcloud-ddns:latest
The script comes from this post.