favonia / cloudflare-ddns

🌟 A small, feature-rich, and robust Cloudflare DDNS updater

docker selfhosted go golang docker-compose dns dns-over-https ddns dynamic-dns cloudflare ddns-client ddns-updater docker-image healthchecks ipv6

Cloudflare DDNS

Cloudflare DDNS is a feature-rich and robust Cloudflare DDNS updater written in Go. It supports IPv4 and IPv6, DNS-over-HTTPS, and custom domains. Cloudflare DDNS is also self-hosted and can be easily deployed using Docker or Docker Compose.

Features

  • Supports IPv4 and IPv6
  • Supports DNS-over-HTTPS
  • Supports custom domains
  • Self-hosted
  • Easy to deploy using Docker or Docker Compose
  • Healthchecks
  • Automatic updates
  • Detailed logging

How to Use

To use Cloudflare DDNS, you will need to create a Cloudflare API token. You can do this by logging into your Cloudflare account and going to the "API Tokens" page. Once you have created an API token, you can follow the instructions below to deploy Cloudflare DDNS.

Docker

docker run -d \
  --name cloudflare-ddns \
  -e CF_API_TOKEN=<your-cloudflare-api-token> \
  -e CF_ZONE_ID=<your-cloudflare-zone-id> \
  -e CF_DOMAIN=<your-cloudflare-domain> \
  -e CF_SUBDOMAIN=<your-cloudflare-subdomain> \
  cloudflare/ddns

Docker Compose

version: "3"

services:
  cloudflare-ddns:
    image: cloudflare/ddns
    environment:
      - CF_API_TOKEN=<your-cloudflare-api-token>
      - CF_ZONE_ID=<your-cloudflare-zone-id>
      - CF_DOMAIN=<your-cloudflare-domain>
      - CF_SUBDOMAIN=<your-cloudflare-subdomain>
    restart: always

Healthchecks

Cloudflare DDNS includes a healthcheck endpoint that can be used to verify that the service is running properly. The healthcheck endpoint is located at /health.

Automatic Updates

Cloudflare DDNS can be configured to automatically update your DNS records when your IP address changes. To enable automatic updates, set the CF_UPDATE_INTERVAL environment variable to the desired interval in seconds.

Logging

Cloudflare DDNS logs all activity to the console. You can view the logs by running the following command:

docker logs cloudflare-ddns