Dockerised service updating your Gandi domain's A
& CNAME
records.
Used environment variables for configuration:
API_KEY
: gandi api keyDOMAIN
: managed domain (egexample.com
)A_RECORDS
: space separated A records to update (eg@ www blog
); optional if onlyC_RECORDS
are wantedC_RECORDS
: space separated CNAME records to update (egwww blog target.com
); optional if onlyA_RECORDS
are wanted; note this takes semicolon-separated list of records in formatname1 name2 nameN target
, egftp target1.example.com.;blog web mail target2.example.com.
would create CNAME record forftp
pointing totarget1.example.com
, andblog, web, mail
subdomains pointing totarget2.example.com
OVERWRITE
:true|false
; passtrue
if configured records should replace all the existing records at every execution. optional - defaults tofalse
ALWAYS_PUBLISH_CNAME
:true|false
; passtrue
if CNAME records should be published with every execution, not only with the one ran at the container startup; forced totrue
ifOVERWRITE=true
; optional - defaults tofalse
PUBLISH_ONLY_ON_IP_CHANGE
:true|false
; passfalse
if gandi api should be called with every execution, not only when our IP has changed from previously known IP; optional - defaults totrue
TTL
: 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