npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@keeftraum/cloudflare-update-ip

v1.2.4

Published

A Python utility for batch updating, backing up, and restoring DNS records across one or more Cloudflare zones.This tool is designed for sysadmins and developers who need to automate DNS management tasks, such as updating IP addresses, replacing old recor

Downloads

9

Readme

Cloudflare Update IP

Easily update all Cloudflare DNS records (A, AAAA, CNAME, TXT, SRV, MX, NS, PTR, CAA, CERT, DNSKEY, DS, LOC, NAPTR, SMIMEA, SSHFP, SVCB, TLSA, URI, and more) to a new IP address using a simple script. Ideal for server migrations, dynamic IP environments, or bulk DNS changes.

The tool can also be installed globally from npm as @keeftraum/cloudflare-update-ip.


🚀 Features

  • Bulk Update: Updates all supported DNS record types across all zones or a single zone.
  • Flexible Matching: Replaces any occurrence of the old IP in record content with the new IP (not just A records).
  • .env Configuration: Simple environment variable setup for credentials and options.
  • Dry Run & Debug: Preview changes and get detailed logs before applying updates.
  • Backup & Restore: Easily backup and restore DNS records for safety.
  • Colorful Output: Clear, color-coded console output for easy tracking.
  • HTML Report: Use --html-report report.html to generate a visual summary of all changes.
  • Windows Friendly: Built for Windows, but works cross-platform with Python.
  • Self-Update Check: Automatically checks GitHub for a newer version and offers to update before running.
  • Interactive Prompts: Missing environment variables are asked for at runtime.
  • NPM CLI: Install globally with npm i -g @keeftraum/cloudflare-update-ip and run the tool using cloudflare-update-ip.

📦 Requirements

  • Python 3.7+
  • requests, python-dotenv, colorama, pyfiglet (install via pip install -r requirements.txt)
  • Cloudflare API token with DNS edit permissions
  • (Optional) Node.js 14+ for using the npm-based CLI

⚡ Quick Start

  1. Clone the repository:

    git clone https://github.com/SkyLostTR/Cloudflare-Update-IP.git
    cd Cloudflare-Update-IP
  2. Install dependencies:

    pip install -r requirements.txt
  3. Configure your environment:

    cp .env.example .env   # use `copy` on Windows

    Edit .env and set:

    • CLOUDFLARE_API_TOKEN – your Cloudflare API token
    • NEW_IP – the new IP address to assign
    • OLD_IP – (optional) the current IP address to search/replace
    • TARGET_DOMAIN – (optional) domain to update (default: all zones)
    • DRY_RUN – (optional) set to 1 to preview changes
    • DEBUG – (optional) set to 1 for verbose logging
    • CENSOR – (optional) set to 0 to disable censoring of log output
  4. Run the script:

    python CloudflareUpdate.py --html-report report.html

    The script will check GitHub for updates before executing. Run python CloudflareUpdate.py -h to see all available options and environment variables.

    Backup / Restore:

    python CloudflareUpdate.py --backup
    python CloudflareUpdate.py --restore

Use via npm

Alternatively, install the CLI globally from npm and run it anywhere:

npm install -g @keeftraum/cloudflare-update-ip
cloudflare-update-ip --html-report report.html

The npm package runs a postinstall script that installs the required Python dependencies using pip, so make sure Python is available on your system.


🛠️ Usage

  • By default, every supported DNS record (A, AAAA, CNAME, TXT, SRV, MX, NS, PTR, CAA, CERT, DNSKEY, DS, LOC, NAPTR, SMIMEA, SSHFP, SVCB, TLSA, URI, etc.) in all zones will be updated if their content matches the old IP.
  • Set TARGET_DOMAIN in .env to limit updates to a single zone.
  • Use DRY_RUN=1 to preview changes without applying them.
  • Use DEBUG=1 for detailed logs in debug_output.txt.
  • Use --html-report report.html to generate a visual report of all record changes.
  • Use CENSOR=0 to display uncensored environment values in output.
  • If installed via npm, run the tool with cloudflare-update-ip instead of the Python file.
  • Always keep your .env file private. Never commit it to version control.

✅ Tests

Run the automated checks with:

npm test

This compiles the Python script and verifies the Node CLI wrapper.


📚 Documentation


🙏 Credits

Created and maintained by @SkyLostTR (@Keeftraum) ASCII banner generated with pyfiglet


🪪 License

Released under the MIT License. See LICENSE.


⚠️ Disclaimer

This project is provided as-is, without any warranty or guarantee of fitness for a particular purpose. Use at your own risk. The author (@SkyLostTR) is not responsible for any data loss, misconfiguration, downtime, or other issues that may arise from using this script. Always backup your DNS records before making bulk changes and review all changes in dry-run mode before applying them.