Jens Segers on May 21 2016

Dynamic DNS for CloudFlare with ddclient

Today I found out that ddclient added support for CloudFlare since version 3.8.2. Unfortunately, Ubuntu 14.04 ships with version 3.8.1, but I will show you how to update it.

It is actually easier to have the old version still installed because it sets up the background daemon. So make sure ddclient is installed, and perl has json support:

> sudo apt-get install ddclient libjson-any-perl

Now download and extract the last version of the ddclient binary. At the time of writing, the latest version is 3.8.3, click here to see if there is a newer version available and modify the download link below:

> wget http://downloads.sourceforge.net/project/ddclient/ddclient/ddclient-3.8.3.tar.bz2
> tar -jxvf ddclient-3.8.3.tar.bz2

Then, overwrite the existing binary with the newer one:

> cp -f ddclient-3.8.3/ddclient /usr/sbin/ddclient

In this version, the location of the default configuration file has changed from /etc/ddclient.conf to /etc/ddclient/ddclient.conf. So create the new directory and move the old configuration file (or just create a new one):

> mkdir /etc/ddclient
> mv /etc/ddclient.conf /etc/ddclient

Below is my ddclient configuration using the cloudflare protocol. Use your CloudFlare global API key as the password, you can find it in the account section section. Make sure you replace all the values between *'s.

daemon=1800
protocol=cloudflare
use=web
server=www.cloudflare.com
ssl=yes
login=*cloudflare-email*
password=*cloudflare-global-api-key*
zone=*cloudflare-domain*
*full-hostname*

Hope this guide was useful!


Comments

Michael Moller 2 months ago

@jurgenweber

Try: sudo apt-get install ca-certificates

Reference Link: https://sourceforge.net/p/ddclient/discussion/399428/thread/06c55d61/


jurgenweber 2 months ago

I keep getting

 ddclient[15498]: WARNING:  cannot connect to www.cloudflare.com:443 socket: Network is unreachable IO::Socket::IP configuration failed
ddclient[15498]: FAILED:   updating example.com: Could not connect to www.cloudflare.com.

any ideas?


Gino 3 months ago

What should i put on Full host name


Ben Walters 8 months ago

Thanks for the walkthrough, Jens! It's easy to follow and saved me a lot of time in updating my guide on Setting Up a Raspberry Pi Web Server . I hope you don't mind me sharing your post.


aa6my1 9 months ago

@ismail sudo ddclient -daemon=0 -debug -verbose -noquiet


░▒▓█│【Walkman】│█▓▒░ 10 months ago

I had 3.8.2 and it said the cloudflare protocol didn't exists, thanks very much for this, and the config


ismail 11 months ago

how to make it autorun on startup