Dyn-Cloudflare-DDNS is a simple Python 3.12.x script that retrieves an IP address from a Dynamic DNS provider (Dyn, No-IP, etc) and uses that to update Cloudflare's DNS. The reason for this script is that many routers have the capability to update DDNS services, but usually Cloudflare isn't supported.
In order for this script to work, you need to have an account with a Dynamic DNS provider and an account with Cloudflare.
This script uses Poetry and depends on Cloudflare and DNSPython.
$ poetry install
This script uses environment variables for its configuration
Variable | Required | Description |
---|---|---|
CF_ZONE | Yes | Cloudflare Zone to be updated |
DDNS_HOST | Yes | Dynamic Hostname where the IP will be retrieved from |
CF_API_KEY | Yes | Cloudflare API Key (v4) |
DDNS_RTYPE | No | DNS Record Type (Only A or AAAA) |
$ poetry run python3 dyn-cloudflare-ddns
docker run -e CF_API_KEY='<CF_KEY>' -e DDNS_HOST='<DDNS_HOST>' -e CF_ZONE='<CF_ZONE>' -d --name dyn-cloudflare-ddns ghcr.io/codegeek/dyn-cloudflare-ddns