A lightweight Dynamic DNS updater for Cloudflare, running in a Docker container on Alpine Linux.
Automatically keeps your Cloudflare DNS A records pointing to your current public IP, and ensures a wildcard CNAME (*) exists for each zone.
- Fetches your public IP from
api.ipify.org - For each configured zone:
- Looks up the Zone ID via the Cloudflare API
- Creates or updates the root A record (
@) if the IP has changed - Creates a wildcard CNAME record (
* -> @) if it doesn't exist
- Sleeps for the configured interval, then repeats
The container handles SIGTERM/SIGINT for graceful shutdown and runs as a non-root user.
| Variable | Required | Default | Description |
|---|---|---|---|
CF_TOKEN |
Yes | — | Cloudflare API token with DNS edit permissions |
ZONES |
Yes | — | Comma-separated list of zones (e.g. example.com,example.org) |
INTERVAL |
No | 300 |
Seconds between update cycles |
PROXIED |
No | false |
Enable Cloudflare proxy (true or false) |
TTL |
No | 120 |
DNS record TTL in seconds |
docker run -d \
--name cloudflare-ddns \
--restart unless-stopped \
-e CF_TOKEN="your-cloudflare-api-token" \
-e ZONES="example.com,example.org" \
-e INTERVAL=300 \
-e PROXIED=false \
dfelix/cloudflare-ddnsservices:
cloudflare-ddns:
image: dfelix/cloudflare-ddns
container_name: cloudflare-ddns
restart: unless-stopped
environment:
CF_TOKEN: "your-cloudflare-api-token"
ZONES: "example.com,example.org"
INTERVAL: 300
PROXIED: false
TTL: 120Available on Docker Hub: dfelix/cloudflare-ddns
docker pull dfelix/cloudflare-ddnsCreate a token at Cloudflare Dashboard > API Tokens with:
- Permissions: Zone > DNS > Edit
- Zone Resources: Include > Specific zone (or All zones)
MIT