Skip to content

pascaliske/docker-cloudflare-dyndns

Simple container image to update a dynamic DNS record using the Cloudflare API.

Docker Image Version (tag latest semver) Docker Image Size (tag) Docker Pulls GitHub Tag Build Status GitHub Last Commit License: MIT Awesome Badges

Image

Registry Image
GitHub ghcr.io/pascaliske/cloudflare-dyndns
Docker Hub pascaliske/cloudflare-dyndns

The following platforms are available for this image:

$ docker run --rm mplatform/mquery ghcr.io/pascaliske/cloudflare-dyndns:latest
Image: ghcr.io/pascaliske/cloudflare-dyndns:latest
 * Manifest List: Yes
 * Supported platforms:
   - linux/amd64
   - linux/arm/v7
   - linux/arm64

Usage

To use this image pull it from one of the following registries:

# github container registry
docker pull ghcr.io/pascaliske/cloudflare-dyndns

# docker hub
docker pull pascaliske/cloudflare-dyndns

Then run it using the following command:

# github container registry
docker run --rm -e CF_API_TOKEN=xyz -e DOMAIN=domain.com -e NAME=my ghcr.io/pascaliske/cloudflare-dyndns

# docker hub
docker run --rm -e CF_API_TOKEN=xyz -e DOMAIN=domain.com -e NAME=my pascaliske/cloudflare-dyndns

This will update the subdomain record my.domain.com in the DNS zone domain.com with your current IP address.

Configuration

You can configure the container with the following additional environment variables:

Variable Required Default Description
TZ No UTC Adjust the time zone inside the container
IP_SERVICE No ifconfig.co The IP service to retrieve your public IP address
DOMAIN Yes - Your DNS zone within Cloudflare
NAME Yes - Your Subdomain record to update
CF_API_TOKEN Yes - Your Cloudflare API token

Kubernetes

If you want to use this tool as an CronJob inside of a Kubernetes cluster check out my ready to deploy Helm chart!

License

MIT – © 2022 Pascal Iske