Cloudflare-DDNS: A Feature-Rich and Robust Cloudflare DDNS Updater

Summary
Cloudflare-DDNS is a small, feature-rich, and robust Cloudflare DDNS updater written in Go. It automatically detects your machine's public IP addresses and updates DNS records using the Cloudflare API. This tool is ideal for self-hosting enthusiasts needing reliable dynamic DNS management.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Cloudflare-DDNS is an efficient and robust dynamic DNS (DDNS) updater designed specifically for Cloudflare. Written in Go, this tool automatically detects your public IP addresses (both IPv4 and IPv6) and updates your Cloudflare DNS records. It's built with a small footprint and a strong focus on security and comprehensive domain support.
Installation
The easiest way to get started with Cloudflare-DDNS is by using Docker Compose. First, ensure you have Docker and Docker Compose installed on your system. You will need a Cloudflare API Token with appropriate permissions (Zone - DNS - Edit, and optionally Account - Account Filter Lists - Edit for WAF lists).
Step 1: Create your docker-compose.yml
file
services:
cloudflare-ddns:
image: favonia/cloudflare-ddns:latest
network_mode: host # Bypasses network isolation, makes IPv6 easier
restart: always # Restart the updater after reboot
environment:
- CLOUDFLARE_API_TOKEN=YOUR-CLOUDFLARE-API-TOKEN # Your Cloudflare API token
- DOMAINS=example.org,www.example.org # Your domains (separated by commas)
- PROXIED=true # Optional: Tell Cloudflare to cache webpages and hide your IP
# - IP6_PROVIDER=none # Optional: Add this line to disable IPv6 completely
Step 2: Run the container
docker-compose pull cloudflare-ddns
docker-compose up --detach --build cloudflare-ddns
Why Use Cloudflare-DDNS?
Cloudflare-DDNS stands out with its comprehensive features and robust design:
- Efficiency: The Docker image is less than 5 MB, it re-uses HTTP connections, and caches Cloudflare API responses to reduce usage.
- Complete Domain Support: It fully supports simple domains, internationalized domain names, and wildcard domains. You can also toggle IPv4 (
A
records) and IPv6 (AAAA
records) for each domain. - Cloudflare-specific Features: Toggle Cloudflare proxying, set comments for new DNS records, and maintain Cloudflare WAF lists of detected IP addresses.
- Integration with Notification Services: The updater can report to Healthchecks or Uptime Kuma, and actively send notifications via any service supported by the Shoutrrr library (emails, messaging platforms, webhooks).
- Minimum Privacy Impact: By default, public IP addresses are obtained via Cloudflare's debugging page, minimizing privacy concerns.
- Attention to Security: It uses only HTTPS or DNS over HTTPS for IP detection, making it harder to trick the updater. Docker images can be verified with
cosign
, and it relies on established open-source Go libraries.
Links
- GitHub Repository: https://github.com/favonia/cloudflare-ddns
- Go Reference: https://pkg.go.dev/github.com/favonia/cloudflare-ddns/
- Docker Hub: https://hub.docker.com/r/favonia/cloudflare-ddns