A small, safety-focused dynamic DNS updater for Cloudflare. It supports multiple zones, multiple A and AAAA records, configuration reloads between cycles, dry runs, and an optional guarded pruning mode.
Release status: This project is an initial public alpha. Test with
--dry-runbefore allowing it to change DNS records.
- API tokens are read only from
CF_API_TOKEN; never place them in YAML. - The example configuration uses reserved
example.comnames. - Record creation is configurable and disabled by default when omitted.
- Record pruning is disabled by default.
- Pruning requires both
prune_unlisted_a_records: trueand--allow-prune. --dry-runperforms reads and reports planned writes without changing DNS.
Pruning applies to every A record in each configured zone. When enabled, an A record
whose normalized name is absent from the configuration will be deleted. Always inspect
a dry run before using --allow-prune.
- Python 3.10 or newer
- A Cloudflare API token with
Zone:ReadandDNS:Editpermissions, scoped only to the zones the updater manages
python -m venv .venvActivate the environment:
.venv\Scripts\Activate.ps1On macOS or Linux, use source .venv/bin/activate. Then install:
python -m pip install --editable .Copy config.example.yaml to a location outside the repository and replace the reserved
example names with your own records. Set the token in the process environment:
$env:CF_API_TOKEN = "your-scoped-token"On macOS or Linux:
export CF_API_TOKEN="your-scoped-token"Preview a single update cycle:
cloudflare-ddns --config config.yaml --once --dry-runApply changes continuously:
cloudflare-ddns --config config.yamlIf pruning is intentionally enabled in the configuration, preview it first and then add the separate authorization flag:
cloudflare-ddns --config config.yaml --once --dry-run --allow-prune
cloudflare-ddns --config config.yaml --allow-pruneThe systemd/cloudflare-ddns.service file is a
reference unit. Review its paths, install the project in /opt/cloudflare-ddns, keep the
configuration and environment file under /etc/cloudflare-ddns, and restrict the
environment file to the service administrator.
python -m pip install --editable ".[dev]"
ruff check .
pytestMIT © 2026 CodeVelo.dev LLC.