gandi-dns-update is a DNS updater for Gandi.net, which is ideal for use in container environments. It follows the principles of twelve-factor app. Whenever possible, networking timeouts are used to avoid hanging the application.
resolver1.opendns.com.myip.opendns.com to lookup the current dynamic IP.DOMAIN_IP is given, disable the dynamic lookup and use this IP address.Network Timeouts (currently not configurable):
I was in need for a tool like this for quite some time, and although there seem many projects like this one, most are either unmaintained, use either Python or Go (fill in arbitrary programming language here), using deprecated requirements, use configuration files, only use the system resolver, or do not use networking timeouts. At some point last year, I wrote a quick and dirty sketch in Python (using dns-lexicon) which worked (besides timeouts), but the container image had a size of 70 MiB. Running it in Kubernetes every 5 minutes 24/7 revealed that sometimes the job hangs because of a race conditions in the DNS resolver logic. This lead me to rewrite it from scratch in Rust, using trust-dns-resolver and reqwest which both internally use the Tokio runtime (this somehow contradicts the plan to create a minimal executable), but with a size of 2.5 MiB of the compressed container image, I find it acceptable.
cargo build --release
Please find container images on docker hub. An automatic build is configured for HEAD as :latest and RELEASES as numbered tags.
The following environment variables are understood:
GANDI_API_KEY :: Gandi Live DNS API keyDOMAIN_IP :: Optionally disable current dynamic IP lookup and use this IP addressDOMAIN_FQDN :: Domain to be managed, ending with a dot '.'DOMAIN_DYNAMIC_ITEMS :: List of entries within a domain to be updated. For example 'a' or 'a,b' will process the A records a.domain.tld and respectively b.domain.tld if domain.tld is given as DOMAIN_FQDNNOTE: the domain must be fully qualified and needs to end with a dot '.'. The program will panic, if not full-filled.
Example usage as container:
docker run --rm \
-e GANDI_API_KEY=your-api-key \
-e DOMAIN_FQDN=domain.tld. -e DOMAIN_DYNAMIC_ITEMS=a,b,c \
image-name:latest
Example usage with Cron:
*/5 * * * * /usr/bin/env -i GANDI_API_KEY=your-api-key DOMAIN_FQDN=domain.tld. DOMAIN_DYNAMIC_ITEMS=a,b,c /path/to/gandi-dns-update
Content type
Image
Digest
Size
2.4 MB
Last updated
over 6 years ago
docker pull bwolf/gandi-dns-update:0.1.0