Python script running as a cronjob in Docker to update Cloudflare DNS records.
Allows the user to specify a list of subdomains that will be dynamically updated and/or created against an existing Cloudflare zone.
Cloudflare domain proxying is configuable via an exclusion list.
IPv6 addresses should be supported but I have not tested this feature.
This project is heavily inspiried by juusujanar's cloudflare-ddns project and is largely a copy paste of this example provided in the cloudflare/python-cloudflare repo.
All that you will need to get started is the email address you used to sign up with Cloudflare, the name of your dns zone, the list of subdomains you would like to add to Cloudflare, and your Cloudflare api key.
This application is desinged to be run standalone or via Docker
docker run --name "cloudflareddns" \
-e "CF_ZONE_NAME=yourdomain.com" \
-e "CF_DNS_NAMES=host1,host2,host3" \
-e "CF_DNS_NAMES_NO_PROXY=host3" \
-e "CF_API_EMAIL=user@example.com" \
-e "CF_API_KEY=00000000000000000000000000000000" \
"userhas404d/cloudflareddns:latest"
Configure the following environment variables
export CF_ZONE_NAME="yourdomain.com"
export CF_DNS_NAMES="host1,host2,host3"
export CF_DNS_NAMES_NO_PROXY="host3"
export CF_API_EMAIL='user@example.com'
export CF_API_KEY='00000000000000000000000000000000'
Configure your python env
pip install -r requirements.txt
And finally, run the application
python update-dynamic-dns.py
I'm a heavy Unraid user and wanted to be able to use the wildcard option available in the linuxserver/letsencrypt docker. Unfortunately, that container's DNSPLUGIN
option doesn't support my previous DNS provider.