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.