Skip to main content
  1. posts/

CloudFlare Dynamic DNS Update Script (cf-ddns.sh)

·167 words·1 min·
Christian Mohn
Homelab bash Cloudflare Dynamic DNS Homelab Scripting
Author
Christian Mohn
IT veteran, podcaster, author, and blogger from Bergen, Norway.

As a part of my Homelab project, I’ve created a proper bash script to provide dynamic DNS updates for external resources, via CloudFlare. More details on the reasoning behind it can be found in Using CloudFlare for Dynamic DNS, but since that was posted I’ve fleshed the script out quite a bit more.

The new and updated script can be found on GitHub: cf-ddns.sh. It now writes events to syslog when it runs, so you can use VMware Log Insight (or another log solution) to capture the events, and use it to track public IP changes if you want. I’ve also added a -f parameter to it, so you can force an IP update even if the values have not changed since the last run.

It’s pretty self explanatory, just replace your own values from CloudFlare for the variables, and if you want to update more than one record, just copy the update block and edit it for the extra entries.

Hopefully someone will find this useful.

Related

Using CloudFlare for Dynamic DNS
·442 words·3 mins
Christian Mohn
Homelab API Cloudflare DNS Dynamic DNS Homelab Scripting
Dynamic DNS Requirements
·360 words·2 mins
Christian Mohn
Homelab Cloudflare DNS Dynamic DNS Homelab Scripting
Taking IT too Far
·187 words·1 min
Christian Mohn
Homelab News