Update Cloudflare DNS records with your network's external IP address
Project description
ZDDNS
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd22fee1b82ba97b2635e831cdac693d1d7eb125deff3b8577f3ec1551d71017
|
|
| MD5 |
1f81a78f87fbd8c65b9aab9f859c3cf5
|
|
| BLAKE2b-256 |
3ef1172ac12f133f933e0422b8191298bfb39605d41de920e60530aad1e07a42
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c3b9f04c41575be85e9a46845ec1efff7dfd0b42d11438f80386b6705385c3c
|
|
| MD5 |
8f11cd05fe2e158c81cfa4a1ca6791f9
|
|
| BLAKE2b-256 |
4b7e6a3003367e91027b19aab7241850500d603338b5e80fe8cdcc00d923e5b5
|