How to use Cloudflare for Dynamic DNS on Ubuntu 20.04

From: jacobjangles.com/free-dd…

Create the subdomain in Cloudflare, and set to DNS only. Unless you are hosting a website at that subdomain.

On the server install ddclient.

sudo apt install ddclient

Grab the latest version

wget https://github.com/ddclient/ddclient/raw/master/ddclient
sudo cp ddclient /usr/sbin/ddclient
sudo mkdir /etc/ddclient
sudo mv /etc/ddclient.conf /etc/ddclient/

nano -w /etc/ddclient/ddclient.conf

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
# Configuration file for ddclient

##
## Global Config
##
daemon=500
ssl=yes

##
## sub.domain.tld - Cloudflare ## Update Me
##
protocol=cloudflare
use=web
[email protected] ## Update Me with cloudflare login email
password=abcredactedxyz ## Update Me with cloudflare Global API found under "My profile --> API tokens"
zone=domain.tld ## Update Me with the domain
sub.domain.tld ## Update Me with the subdomain

To test:

sudo ddclient -query
sudo ddclient -daemon=0 -verbose -noquiet
sudo service ddclient status

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.