Skip to content

About

How to update cloudflare dns with ddclient in docker

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddclient-cloudflare-docker

How to update cloudflare dns with ddclient in docker

I had a need to use dns for a personal project and went down the rabbit hole of dynamic dns. Instead of using a ddns provider, I settled on creating a record in a zone in cloudflare and using ddclient to monitor and update the record's ip when it changes.

I found a few blog and forum posts about how to use ddclient with cloudflare but it still took some hacking to get everything working. I've created this repo to bridge the gap between what's online and what it takes to get ddclient and cloudflare wired up.

Gotchas Discovered

  • Cloudflare deprecated the api version that ddclient originally used -- https://www.cloudflare.com/migrating-to-v4/
  • The version of ddclient in the ubuntu focal repo (3.8.3) still uses cloudflare's deprecated api. To get the latest version, this repo installs ddclient from github.

Setup

  1. Create a cloudflare api token using the Edit Zone DNS template. For Zone Resources select All zones - https://developers.cloudflare.com/api/tokens/create
  2. Clone this repo
git clone https://github.com/pedrorito/ddclient-cloudflare-docker.git
cd ddclient-cloudflare-docker
  1. Update the following in ddclient.conf. If needed, here's some config examples from the source
    • password=
    • zone=
    • RECORD_TO_UPDATE
  2. Start the container
docker-compose up -d

Validation

ddclient's logs are captured by docker. They're available by running docker-compose logs -f ddclient. Successful logs should look similar to:

SUCCESS:  $record -- Updated Successfully to $ip

Troubleshooting

  • To enable verbose logging, in ddclient.conf set verbose=yes then run docker-compose restart ddclient to restart the container.
  • To execute commands from the project's troubleshooting docs, open a shell in the container by running docker-compose exec ddclient bash

About

How to update cloudflare dns with ddclient in docker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages