Dynamic DNS with Cloudflare, with optional CDN proxy
875
A simple dockerised application to get the current public IP address and update a Cloudflare DNS record (with optional ability to proxy through their CDN).
See api.cloudflare.com for full details.
The container requires the following environment variables:
Either:
CF_EMAIL - your email address registered for the cloudflare account; andCF_API_KEY - can generated rom the bottom of the "API Tokens" page, found hereOr (note you only need the token, not the email as well):
CF_API_TOKEN - preferred method nowadays of providing scoped access to cloudflare resources. I found that I need to grant the following edit permissions (although your mileage may vary): Zone.Zone and Zone.DNS.You also need to provide the DNS records that you want to be updated by using the -r or --record flag. You can pass in a separated list to update multiple records if wanted Eg. -r home.mydomain.com vpn.myseconddomain.dev.
docker run --name=cloudflare-dyn-dns \
-e CF_API_TOKEN=2393980hf3fjwkbfhbd2 \
saracen9/cloudflare-dyn-dns -r home.mydomain.com vpn.myseconddomain.dev
Additional flags are available, including the ability to toggle the Cloudflare proxy (on by default).
usage: [-h] [-r RECORD [RECORD ...]]
[--proxy | --no-proxy] [-v | -q]
Update Cloudflare DNS records with your current
IP address.
optional arguments:
-h, --help show this help message
and exit
-r RECORD [RECORD ...], --record RECORD [RECORD ...]
DNS records we want to
keep updated. Multiple
allowed
--proxy Enable the Cloudflare
proxy.
--no-proxy Disable the Cloudflare
proxy.
-v, --verbose Increase script logging
verbosity.
-q, --quiet Run script without any
output.
Content type
Image
Digest
Size
144.5 MB
Last updated
over 4 years ago
docker pull saracen9/cloudflare-dyn-dns