Skip to main content

Update Cloudflare DNS records with your network's external IP address

Project description

ZDDNS

CI CD PyPI version Docker Hub GitHub Container Registry License: MIT

A Python utility to automatically update Cloudflare DNS records with your network's external IP address.

Features

  • Automatically discovers your external IP address
  • Updates specified Cloudflare DNS records
  • Configurable via YAML configuration file
  • Command-line interface for easy usage
  • Logging for tracking updates and troubleshooting
  • Docker support for containerized deployment
  • CI/CD pipeline for automated testing and deployment

Installation

From PyPI

# Install the latest version
pip install zddns

From Source

# Clone the repository
git clone https://github.com/gzamboni/zddns.git
cd zddns

# Using uv (recommended)
uv pip install .

# Or using pip
pip install .

Using Docker

# Pull from Docker Hub
docker pull gzamboni/zddns:latest

# Or pull from GitHub Container Registry
docker pull ghcr.io/gzamboni/zddns:latest

# Run with Docker
docker run -v /path/to/config:/config gzamboni/zddns

See DOCKER.md for more detailed Docker instructions.

Configuration

Create a configuration file at ~/.config/zddns/config.yaml with the following structure:

cloudflare:
  api_token: "your-cloudflare-api-token"
  zone_id: "your-zone-id"
  record_name: "subdomain.example.com"
  ttl: 120  # Optional, defaults to 1 (automatic)
  proxied: true  # Optional, defaults to false

ip_providers:
  - "https://api.ipify.org"
  - "https://ifconfig.me/ip"
  - "https://icanhazip.com"

check_interval: 300  # Seconds between checks, defaults to 300 (5 minutes)

You can also specify a custom configuration file location using the --config option.

Usage

# Run once and exit
zddns --once

# Run as a daemon, checking periodically
zddns

# Specify a custom configuration file
zddns --config /path/to/config.yaml

# Show current IP without updating DNS
zddns --show-ip

# Show help
zddns --help

Docker Compose Example

version: '3'

services:
  zddns:
    image: gzamboni/zddns:latest
    container_name: zddns
    restart: unless-stopped
    volumes:
      - ./config:/config
    environment:
      - TZ=UTC

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute to this project.

Security

For security issues, please see our Security Policy.

Code of Conduct

Please note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.

Changelog

See CHANGELOG.md for a list of changes in each release.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zddns-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zddns-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file zddns-0.1.0.tar.gz.

File metadata

  • Download URL: zddns-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zddns-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd22fee1b82ba97b2635e831cdac693d1d7eb125deff3b8577f3ec1551d71017
MD5 1f81a78f87fbd8c65b9aab9f859c3cf5
BLAKE2b-256 3ef1172ac12f133f933e0422b8191298bfb39605d41de920e60530aad1e07a42

See more details on using hashes here.

File details

Details for the file zddns-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zddns-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zddns-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c3b9f04c41575be85e9a46845ec1efff7dfd0b42d11438f80386b6705385c3c
MD5 8f11cd05fe2e158c81cfa4a1ca6791f9
BLAKE2b-256 4b7e6a3003367e91027b19aab7241850500d603338b5e80fe8cdcc00d923e5b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page