Dynamically update DNS record on IP change using Cloudflare API
Before starting, you'll need NodeJS in order to run this program
I recommend using the LTS version but it shouldn't matter
Firstly, clone this repository
git clone https://github.com/TheDavidDelta/cloudflare_ddns_node
Then install the project's dependencies detailed in the package.json
file by running
npm i
Now create a .env
file with the following fields
TOKEN=your cloudflare token
ZONE=the zone where the record is
RECORDS=comma separated list of record names
You can generate a Cloudflare Token here
Lastly, just schedule its execution with any kind of software
For example, you may like to use Linux's crontab
or Windows' Task Scheduler
Here's an example for running the program every 6 hours using Linux's crontab
0 */6 * * * cd /path/to/the/folder/cloudflare_ddns_node && npm start
Make sure to configure folder's and crontab
's user permissions correctly
Copyright © 2020 TheDavidDelta
This project is GNU GPLv3 licensed