Skip to content

Instantly share code, notes, and snippets.

Last active March 11, 2021 04:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
ddclient for Cloudflare DNS / DO

This is a ddclient setup for updating Cloudflare DNS from a DO droplet.

You do get one free floating IP which makes dynamic DNS pointless, but you'll get charged if you want to turn off the droplet. Running ddclient lets you keep using Cloudflare DNS without manually updating your A records.

Debian Buster (current stable) only has ddclient 3.8.3 which has trouble with the v4 Cloudflare API, so we get ddclient from GitHub.

apt install perl libdata-validate-ip-perl libjson-any-perl
tar xzf ddclient-3.9.1.tar.gz
cp ddclient/ddclient /usr/sbin/
nano /etc/ddclient/ddclient.conf
nano /etc/systemd/system/ddclient.service
systemctl enable ddclient
systemctl start ddclient

Note that the included systemd unit configuration doesn't work, I think because systemd tries to remap the default /var/run pidfile path to /run. So I modified the .service file.

use=web, web=
Description=Dynamic DNS Update Client
ExecStart=/usr/sbin/ddclient -pid /run/ -daemon 890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment