Skip to content

A simple dynamic DNS updater written in JS using the Cloudflare v4 API.

License

Notifications You must be signed in to change notification settings

dev-steinbrecher/cloudflare-dynamic-dns

Repository files navigation

cloudflare-dynamic-dns

This is a small script to change you IP dynamically in Cloudflare in case your internet provider assigns you a new IP adresse.

It supports IPv4 and IPv6

How to use

Run commands

 mkdir "cloudflare-dynamic-dns"
 cd "cloudflare-dynamic-dns"
 wget https://github.com/dev-steinbrecher/cloudflare-dynamic-dns/releases/latest/download/cloudflare-dynamic-dns.zip
 unzip cloudflare-dynamic-dns.zip
 rm cloudflare-dynamic-dns.zip

Create an API token for the Cloudflare API

Create Token

Fill config

  • Rename config.json.default to config.json
  • Token should be your created API token from above
  • Zone ID is the ID that you get from the Cloudflare domain overview in the right panel
{
  "token": "<token>",
  "zoneId": "<zoneId>"
}

Edit Crontab

#add to crontab
*/1 * * * * cd <script dir> && $(which node) update_ip.js