Cloudflare ddns

Cloudflare

From cloudflare we need to generate an API token which we will use later for dynamicly update the our public IP for the A record for the selected domain

Create API token

Open cloudflare dashboard, go to the “API Tokens” section your Cloudflare profile to create a token.

Your new token needs to have:

  • the Zone:DNS:Read permission (not automatically granted in the Write permission)
  • the Zone:DNS:Write permission
  • the “All zones from an account” scope

Save the token as you will need it in the following steps

Linux

Setup a basic linux server or vm, I will carry on with a debian setup

Install the latest version of ddclient

Run the following commands

1
2
apt update
apt install -y ddclient

Configuration

ddclient is controlled by ddclient.conf which we will need to modify

Update “$EMAIL”, “$PASSWORD” and “$HOST” in

“PASSWORD” is the API Token we generated before

/etc/ddclient.conf

1
2
3
4
5
6
protocol=cloudflare \
use=web, web=https://api.ipify.org/ \
login='$EMAIL' \
password='$PASSWORD' \
zone='$HOST' \
$HOST

Restart ddclient service

1
systemctl restart ddclient.service
All rights reserved