alepouna / cloudflare-dynip-updater

Automatically update your Cloudflare DNS records with your local IP. Useful for Dynamic IP environments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cloudflare-dynip-updater v1.1

GitHub issues GitHub license Total alerts Language grade: JavaScript

A tool to use if you have a server with a dynamic IP. The tool will automatically detect your system IP address and update a predefined record on CloudFlare.

Requirements

  • NodeJS v16.8.0 or higher
  • A site running on CloudFlare and a CloudFlare User API Key
  • [Optionally] A Discord server for webhook alerts

Setup

Text tutorial

Run npm install. Clone the confing.example.json and rename to 'config.json' and edit it as you like.

You can find your zones by changing parseinfo.show_zone_ids to true, which will print all your zones. Change to false after they have been printed.

You can find your DNS records for a zone by adding the zone you want to lookup at parseinfo.zone_for_dns_records to a zone ID and then change parseinfo.show_dns_records_for_zone to true. Make sure to change to false after you've got your data.

You can now add zones as you like by copying the template under records and pasting it inside the array. Make sure to add commas before each new record.

{
    "zone_identifier": "ZONE ID", //Zone ID as parsed
    "dns_identifier": "DNS ID", //DNS ID as parsed
    "type": "A/AAAA/CNAME", //Choose either A or AAAA or CNAME
    "name": "", //Record name, INCLUDING the domain (aka as parsed)
    "ttl": "", //TTL time, set to 1 for AUTO
    "proxied": true //Cloudflare orange cloud on/off
}

After you have setup a configuration, run the script using pm2 or another daemonizer so the script runs 24/7.

Video Tutorial

Coming Soon

Issues and Contributors

Feel free to submit issues, ideas and others as well as contribute to the project!

ko-fi

About

Automatically update your Cloudflare DNS records with your local IP. Useful for Dynamic IP environments.

License:Other


Languages

Language:JavaScript 100.0%