This is a small Dynamic DNS client for Cloudflare's Free DNS Service inspired by oznu's cloudflare-ddns project. oznu's client is no longer maintained, so this project is intended to offer an alternative.
There are pre-built docker images available for amd64, arm64, and armv7 platforms allowing you to run it on nearly any host including both the 32-bit and 64-bit Raspberry Pi models.
Docker CLI:
docker run \
--restart=unless-stopped \
-e API_TOKEN=cloudflare-token \
-e ZONE=example.com \
--name cloudflare-ddns-ts \
ghcr.io/pragma8123/cloudflare-ddns-ts
Docker Compose:
---
services:
cloudflare-ddns-ts:
image: ghcr.io/pragma8123/cloudflare-ddns-ts
container_name: cloudflare-ddns-ts
restart: unless-stopped
environment:
- API_KEY=cloudflare-api-token
- ZONE=example.com
API_TOKEN
- Cloudflare API Token. See instructions below if you need help.ZONE
- Cloudflare DNS zone. This is your root domain (i.e. example.com)
RECORDS
- Comma-separated list of DNS records (subdomains) to update. Include @ in your list to update the root domain. Defaults to@
(just the root DNS record).PROXIED
- Set totrue
if you want to use Cloudflare's security proxy. Defaults tofalse
.TZ
- Set timezone for DNS update cron job. Can be any TZ Database name (i.e. America/New_York). Defaults toUTC
.CRON
- Cron schedule for updating DNS records. Defaults to@daily
.
To use this DDNS client, you will need a Cloudflare API token with edit permissions for your zone's DNS settings.
To create a token, navigate to your Cloudflare Dashboard.
- Click 'Create Token'.
- Use the "Edit zone DNS" API token template.
- Under "Zone Resources" use the drop-down to select a specific zone (your domain). Then click "Continue to summary"
- You should see your domain with DNS:Edit to the right.
- Click "Create Token" and you should now see your API token.