Skip to content

MStefan99/Cloudflare-DDNS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare DDNS

Maintenance

What is this?

Cloudflare DDNS is a tiny Node.js DDNS app which automatically updates your records on Cloudflare to match your server IP so that you don't need to worry about having a dynamic IP anymore. (Read more about DDNS here). I developed Cloudflare DDNS because using 3rd-party apps didn't feel safe enough and going through other open-source apps would've taken me too long. This app, however, is under 300 lines of code so you can easily verify how it works before giving it your valuable domain credentials.

Features

Cloudflare DDNS can automatically update any number of A records on any of your domains, either one-time (when you launch it) or continuously, using a configurable timeout. You can also choose whether to reset your records to 0.0.0.0 on an exit and what TTL you want to use.

Prerequisites

  1. You need to have Node.js installed (instructions).
  2. Clone the repository to your computer.
  3. Install dependencies by running npm install.
  4. If your system includes systemctl and you want to use included shell scripts for an easy setup, make them executable with chmod u+x ./*.sh.
  5. Make sure Node has read and write access to the directory the script is located in (or, at least, it can modify the config file).
  6. Run Cloudflare DDNS with node ./index.js.

Installation

Installation was made to be as straightforward as possible.
First time you launch Cloudflare DDNS it will create a ./config.json file with all the options. After that, you can either choose to edit the file manually or run Cloudflare DDNS with an -s flag to go through a setup process. Note that setup may not cover all possible options. You can restart the setup or edit the config later at any point.

Make Cloudflare DDNS run automatically

If your system includes systemctl, you can use the included scripts to automatically install or uninstall Cloudflare DDNS. Installing will make Cloudflare DDNS run when your computer boots and automatically restart on errors.
Run ./install.sh to run and install the app and ./uninstall.sh to stop and uninstall.

Help

Run node ./index.js -h for the list of options and how to use them.