Linux client for automatic dynamic DNS updates on CloudFlare-managed domains
Switch branches/tags
Nothing to show
Clone or download
DylanVanAssche and LINKIWI Ported to Python 3 (#4)
* Ported to Python 3

* Backwards compatible with Python 2

* Shebang line updated for both Python versions
Latest commit b8177de Nov 28, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add .gitignore Dec 22, 2015
LICENSE Add license and update Makefile Dec 25, 2015
Makefile Add license and update Makefile Dec 25, 2015 Add license and update Makefile Dec 25, 2015
cloudflare-ddns Ported to Python 3 (#4) Nov 28, 2018
requirements.txt cloudflare-ddns: add support for subdomains (#3) Jul 4, 2018

CloudFlare DDNS Client

A Linux client for servers hosting CloudFlare-managed domains behind a dynamic external IP address

This Python-based script interfaces with CloudFlare's client API to automatically and periodically update the A records of your CloudFlare domains with your server's current external IP address. This is generally intended for users whose servers are on a residential ISP with no static IP address assignment.


Installation is fairly straightforward. Note that you should install the script on the server whose external IP you want reflected in your domains' DNS records. It is assumed that the server has a Python interpreter already installed.

git clone
cd cloudflare-ddns-client
sudo make install

This will install necessary Python libraries and place a copy of the cloudflare-ddns executable in /usr/local/bin. You can verify access to the executable with which cloudflare-ddns.


You must configure cloudflare-ddns before you can use it.

After successfully installing, simply run

cloudflare-ddns --configure

You will be presented with an interactive prompt to enter in details about your CloudFlare email, API key, and domains to auto-update.

=============Configuring CloudFlare automatic DDNS update client=============
You may rerun this at any time with cloudflare-ddns --configure
Quit and cancel at any time with Ctrl-C

Enter the email address associated with your CloudFlare account.

Enter the API key associated with your CloudFlare account. You can find your API key at
Example: 7d9dfl2fid74lsg50saa9j2dbqm67zn39v673

Enter the domains for which you would like to automatically update the DNS records, delimited by a single comma.
Comma-delimited domains: YOUR_DOMAINS_HERE

Configuration file written to /home/kiwi/.cloudflare-ddns successfully.

After configuration, you should verify that the script works before continuing:

cloudflare-ddns --update-now

At this point, you can either run the script manually every time you would like to update your DNS records, or you can add it to your crontab to have it automatically run periodically. For example, to have the script run at midnight every day:

crontab -e

Then add the entry

0 0 * * * /usr/local/bin/cloudflare-ddns --update-now > /dev/null 2>&1