gandi-dns-update shellscript to maintain A or AAAA records in Gandi zonefile.
4.4K
Dockerised service updating your Gandi domain's A & CNAME records.
Used environment variables for configuration:
API_KEY: gandi api keyDOMAIN: managed domain (eg example.com)A_RECORDS: space separated A records to update (eg @ www blog); optional if only C_RECORDS are wantedC_RECORDS: space separated CNAME records to update (eg www blog target.com); optional if only A_RECORDS are wanted;
note this takes semicolon-separated list of records in format name1 name2 nameN target, eg
ftp target1.example.com.;blog web mail target2.example.com. would create CNAME record for ftp pointing to target1.example.com,
and blog, web, mail subdomains pointing to target2.example.comOVERWRITE: true|false; pass true if configured records should replace all the existing records at every execution.
optional - defaults to falseALWAYS_PUBLISH_CNAME: true|false; pass true if CNAME records should be published with every execution, not only with the one
ran at the container startup; forced to true if OVERWRITE=true; optional - defaults to falsePUBLISH_ONLY_ON_IP_CHANGE: true|false; pass false if gandi api should be called with every execution, not only when
our IP has changed from previously known IP; optional - defaults to trueTTL: dns entry ttl; optional - defaults to 10800CRON_PATTERN: cron pattern to be used to execute the script. optional - execution defaults to every 15 min
(eg */5 * * * * to execute every 5 minutes)Note at the container startup it immediately tries updating the records, and container will halt on any error; this is for sanity check to make sure you don't launch the service with invalid settings. Downside is the container can't be started without Internet connection.
Example docker command:
docker run -d \
--name gandi-dns-update \
-e API_KEY=your_gandi_api_key \
-e DOMAIN=example.com \
-e A_RECORDS='@ www' \
-e C_RECORDS='ftp example.com.;blog web mail target2.example.com.' \
-e CRON_PATTERN='*/5 * * * *' \
layr/gandi-dns-update
Content type
Image
Digest
sha256:56c9f4da5…
Size
10 MB
Last updated
6 months ago
docker pull layr/gandi-dns-update