Sign inSign up

zachbg/cloudflare-ddns

By zachbg

•Updated 6 months ago

Dynamic DNS updater for Cloudflare - keep your domain pointed at your IP

Image
1

2.0K

zachbg/cloudflare-ddns repository overview

⁠cloudflare-ddns

Automatic Dynamic DNS for Cloudflare — keep your DNS records pointed at your home IP.

Docker Image Docker Pulls

⁠Why?

Your ISP changes your IP. This container watches for changes and updates Cloudflare automatically. Unlike alternatives, it:

  • Actually works — existing DDNS images are abandoned or broken
  • Multi-domain — update multiple records at once
  • IPv4 + IPv6 — dual-stack support
  • Auto-creates records — no manual DNS setup needed
  • 2MB image — Alpine-based, tiny footprint
  • Multiple IP sources — failover between ipify, ifconfig, icanhazip

⁠Quick Start

docker run -d --restart=unless-stopped \
  --name cloudflare-ddns \
  -e CF_API_TOKEN=your-cloudflare-api-token \
  -e CF_DOMAINS=home.example.com \
  zachbg/cloudflare-ddns

⁠Docker Compose

services:
  ddns:
    image: zachbg/cloudflare-ddns
    restart: unless-stopped
    environment:
      - CF_API_TOKEN=${CF_API_TOKEN}
      - CF_DOMAINS=home.example.com,vpn.example.com,*.home.example.com
      - CF_PROXIED=true
      - CF_IPV6=false
      - INTERVAL=300

⁠Environment Variables

VariableDefaultDescription
CF_API_TOKENrequiredCloudflare API token
CF_DOMAINSrequiredComma-separated domains to update
CF_PROXIEDtrueEnable Cloudflare proxy (orange cloud)
CF_IPV6falseAlso update AAAA records
CF_CREATEtrueCreate records if they don't exist
INTERVAL300Seconds between checks
LOG_LEVELinfoinfo or debug

⁠Cloudflare API Token

  1. Go to Cloudflare Dashboard → API Tokens⁠
  2. Create token with:
    • Zone / Zone / Read
    • Zone / DNS / Edit
  3. Set as CF_API_TOKEN

⁠Examples

⁠Single Domain
docker run -d -e CF_API_TOKEN=xxx -e CF_DOMAINS=home.example.com zachbg/cloudflare-ddns
⁠Multiple Domains + IPv6
docker run -d \
  -e CF_API_TOKEN=xxx \
  -e CF_DOMAINS="home.example.com,vpn.example.com,media.example.com" \
  -e CF_IPV6=true \
  -e INTERVAL=60 \
  zachbg/cloudflare-ddns
⁠Unproxied (direct IP access)
docker run -d \
  -e CF_API_TOKEN=xxx \
  -e CF_DOMAINS=ssh.example.com \
  -e CF_PROXIED=false \
  zachbg/cloudflare-ddns

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:49500cb2d…

Size

6.9 MB

Last updated

6 months ago

docker pull zachbg/cloudflare-ddns