6.1.5 • Published 8 months ago

@moodboom/cloudflare-sync-dns v6.1.5

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
8 months ago

cloudflare-sync-dns

This command can be called regularly (e.g. via cron) to keep your DNS records up to date when your ISP assigns you a new IP address.

Specifically, the script will:

1) maintain a local copy of the IP that was last set in your cloudflare DNS records 2) check your external IP address, comparing it to the cloudflare DNS record 3) if the external IP has changed:

  • load cloudflare settings and keys from a local JSON file
  • call the cloudflare API to get all DNS record ids
  • call the cloudflare API for each DNS record and update it to the new external IP
  • optionally run firewall and LAN scripts, and ensure all hosts are resolving
  • only after everything is verified, update the local copy of the IP

Installation

  • Install a recent version of node.js
  • Install this module globally
  • a) You can clone the repository then do an npm install -g
  • b) Or you can just do a global install npm install -g cloudflare-sync-dns
  • Copy cloudflareSettings-template.json (in project folder) outside of the module to where you store configurations, and adjust accordingly
  • Specify the settings file when you run, eg: cloudflare-sync-dns /path/to/my/settings.json
  • Add a cron job to run the script regularly. Every minute should work well, as most of the time it just does a local check.

NOTE that you can use this nvm-based bash script to run npm commands from cron:

#!/bin/bash
export NVM_DIR="/home/myhome/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
cloudflare-sync-dns /path/to/settings.json

Documentation | News

Note there is also a command console for a few admin commands.

Usage: csd command

cmd+options short description


sync sy sync this module, ie: pull, commit, tag, push, publish to npm

Most recent commits... f3eef17 3 months ago Really Comment on running node command from cron HEAD -> mai.. Michael Behrns-Miller cast 9efe6b8 3 months ago Comment on running node command from cron tag: 6.1.3 Michael Behrns-Miller cast 07607e7 3 months ago Comment on running node in cron tag: 6.1.2 Michael Behrns-Miller cast 40947b7 3 months ago Allow for reset of firewall before accessing internet tag: 6.1.1 Michael Behrns-Miller cast

Version 6.1.5

6.1.5

8 months ago

6.1.4

11 months ago

6.1.3

11 months ago

6.1.2

11 months ago

6.1.1

11 months ago

6.1.0

11 months ago

6.0.0

11 months ago

5.1.0

11 months ago

5.0.20

11 months ago

5.0.19

11 months ago

5.0.18

12 months ago

5.0.17

12 months ago

5.0.16

12 months ago

5.0.15

12 months ago

5.0.14

1 year ago

5.0.13

1 year ago

5.0.12

1 year ago

5.0.11

1 year ago

5.0.10

1 year ago

5.0.9

1 year ago

5.0.8

1 year ago

5.0.7

1 year ago

5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago