Sign inSign up

connermo/cloudflare-ddns-py

By connermo

•Updated about 1 year ago

A Python Cloudflare DDNS script.

Image
0

389

connermo/cloudflare-ddns-py repository overview

⁠Run the container

docker run -d \
  --name cloudflare-ddns \
  -v $(pwd)/config.ini:/config/config.ini:ro \
  -e UPDATE_INTERVAL=300 \
  --restart unless-stopped \
  cloudflare-ddns

⁠Configuration

[cloudflare]
# Authentication Method 1: Using API Token (Recommended)
# Create from Cloudflare Dashboard:
# My Profile > API Tokens > Create Token
# Requires "Zone.DNS" edit permissions
api_token = your_api_token_here

# First domain configuration
[domain:ddns.example.com]
# Zone ID (Required)
zone_id = your_zone_id_here
record_type = A
ttl = 1
proxied = false

# Second domain configuration
[domain:home.example.com]
zone_id = your_zone_id_here
record_type = A
ttl = 1
proxied = true
⁠Single Domain Configuration (Legacy Support)
[cloudflare]
api_token = your_api_token_here
zone_id = your_zone_id_here
domain = your.domain.here
record_type = A
ttl = 1
proxied = false
⁠Configuration Details
  • Multiple Domain Configuration:

    • Use [domain:domain_name] format for each domain section
    • Each domain can have its own zone ID, record type, and proxy settings
    • Configure any number of domains
    • All domains share the same API token
  • Configuration Parameters:

    • api_token: Cloudflare API token
    • zone_id: Zone ID for the domain (Required)
    • record_type: DNS record type, typically A (IPv4) or AAAA (IPv6)
    • ttl: Time To Live in seconds, 1 for automatic
    • proxied: Enable/disable Cloudflare proxy (CDN)

⁠Getting Required Information

  1. Log in to Cloudflare Dashboard
  2. Click the profile icon in the top right
  3. Navigate to "My Profile" > "API Tokens"
  4. Click "Create Token"
  5. Use "Edit zone DNS" template or create a custom token with DNS edit permissions
  6. Select applicable zones (domains)
  7. Create token and copy it to the config file's api_token field
⁠Getting Zone ID
  1. Log in to Cloudflare Dashboard
  2. Select your domain
  3. Find the Zone ID in the "API" section on the right side of the overview page

Tag summary

Content type

Image

Digest

sha256:45f8376a0…

Size

45.7 MB

Last updated

about 1 year ago

docker pull connermo/cloudflare-ddns-py