README.md

January 4, 2026 · View on GitHub

nextdns-manager

CLI and Web tools for managing NextDNS profiles

NPM Version LICENSE TWEET

Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


Table of Contents

Features

Web App Available: apps.nextdns.abhijithvijayan.in - No installation required!

  • Manage domains across all profiles - Add, remove, enable, or disable domains from allowlist/denylist across all profiles with a single command
  • Sync denylist/allowlist across profiles - Automatically sync domains across all profiles using majority voting
  • Diff profiles - Visualize differences between NextDNS profiles in a table format
  • Clone profiles - Copy entire NextDNS profiles including:
    • Security settings (threat intelligence, safe browsing, cryptojacking protection, etc.)
    • Privacy settings (blocklists, native tracking blockers)
    • Parental control settings (safe search, services, categories)
    • Denylist and allowlist entries
    • Custom rewrites
    • General settings (logs, block page, performance, web3)
  • Automatic verification of cloned profiles
  • Schema validation to detect API changes

Installation

Requires Node.js 20 or later.

npm install -g nextdns-manager-cli

Or run directly with npx:

npx nextdns-manager-cli <command> [options]

Usage

Manage Domain

Add, remove, enable, or disable a domain in the allowlist or denylist across all profiles.

nextdns-manager manage -k <API_KEY> -d <DOMAIN> -l <LIST> [-a <ACTION>] [-p <PROFILES>]

Arguments

ArgumentDescription
-k, --api-keyNextDNS API key
-d, --domainDomain to manage (e.g., example.com)
-l, --listTarget list: allowlist or denylist
-a, --actionAction: add (default), remove, enable, or disable
-p, --profilesSpecific profile IDs to target (default: all profiles)

Examples

# Add domain to denylist across all profiles
nextdns-manager manage -k "your-api-key" -d "malware.com" -l denylist

# Add domain to allowlist
nextdns-manager manage -k "your-api-key" -d "trusted.com" -l allowlist

# Disable a domain (keep it but inactive)
nextdns-manager manage -k "your-api-key" -d "example.com" -l denylist -a disable

# Enable a previously disabled domain
nextdns-manager manage -k "your-api-key" -d "example.com" -l denylist -a enable

# Remove a domain
nextdns-manager manage -k "your-api-key" -d "example.com" -l denylist -a remove

# Target specific profiles only
nextdns-manager manage -k "your-api-key" -d "example.com" -l denylist -p abc123 def456

Sync Lists

Synchronize denylist and allowlist domains across all NextDNS profiles using majority voting.

nextdns-manager sync -k <API_KEY> [-l <LIST>] [-p <PROFILES>] [--dry-run]

Arguments

ArgumentDescription
-k, --api-keyNextDNS API key
-l, --listWhich list to sync: allowlist, denylist, or both (default: both)
-p, --profilesSpecific profile IDs to sync (default: all profiles)
--dry-runShow what would be synced without making changes

How It Works

  1. Fetches all domains from denylist/allowlist across all profiles
  2. For each domain, determines the canonical state using majority voting (enabled wins ties)
  3. Adds missing domains to profiles that don't have them
  4. Updates domain status where it differs from the canonical state

Examples

# Sync both lists across all profiles
nextdns-manager sync -k "your-api-key"

# Preview changes without applying (dry run)
nextdns-manager sync -k "your-api-key" --dry-run

# Sync only denylist
nextdns-manager sync -k "your-api-key" -l denylist

# Sync specific profiles only
nextdns-manager sync -k "your-api-key" -p abc123 def456

Diff Profiles

Visualize differences between NextDNS profiles in a table format.

nextdns-manager diff -k <API_KEY> [-p <PROFILES>] [-s <SECTION>] [--diff-only]

Arguments

ArgumentDescription
-k, --api-keyNextDNS API key
-p, --profilesSpecific profile IDs to compare (default: all profiles)
-s, --sectionSection to compare: all, lists, security, privacy, parental, settings (default: all)
--diff-onlyOnly show rows with differences

Examples

# Compare all profiles across all sections
nextdns-manager diff -k "your-api-key"

# Show only differences
nextdns-manager diff -k "your-api-key" --diff-only

# Compare only security settings
nextdns-manager diff -k "your-api-key" -s security

# Compare specific profiles
nextdns-manager diff -k "your-api-key" -p abc123 def456

Copy Profile

Clone an entire NextDNS profile to a new profile.

nextdns-manager copy -s <SOURCE_API_KEY> -d <DEST_API_KEY> -p <PROFILE_ID> [-f]

Arguments

ArgumentDescription
-s, --source-keyAPI key for the source NextDNS account
-d, --dest-keyAPI key for the destination NextDNS account
-p, --profile-idProfile ID to clone from the source account
-f, --forceForce copy even if unknown API fields are detected

Example

nextdns-manager copy -s "source-api-key" -d "dest-api-key" -p "a1b2c3"

Getting Your API Key

  1. Log in to your NextDNS account
  2. Navigate to Account settings
  3. Generate or copy your API key

Web App

A Next.js web application is also available that provides a graphical interface for all CLI features.

Live Demo: apps.nextdns.abhijithvijayan.in

Features

  • Manage Domain - Add, remove, enable, or disable domains from allowlist/denylist with a visual interface
  • Sync Lists - Sync domains across profiles with real-time progress tracking and dry-run preview
  • Diff Profiles - Compare profiles side-by-side with color-coded differences
  • Copy Profile - Clone profiles between accounts with visual feedback

Self-Hosting

cd source/web
npm install
npm run dev

The web app stores your API key locally in your browser - it's never sent to any server other than NextDNS.

See the Web App README for detailed setup, deployment (Cloudflare, Vercel, etc.), and configuration instructions.

Fields Copied

Security

API FieldNextDNS Setting
threatIntelligenceFeedsThreat Intelligence Feeds
aiThreatDetectionAI-Driven Threat Detection
googleSafeBrowsingGoogle Safe Browsing
cryptojackingCryptojacking Protection
dnsRebindingDNS Rebinding Protection
idnHomographsIDN Homograph Attacks Protection
typosquattingTyposquatting Protection
dgaDomain Generation Algorithms (DGAs) Protection
nrdBlock Newly Registered Domains (NRDs)
ddnsBlock Dynamic DNS Hostnames
parkingBlock Parked Domains
csamBlock Child Sexual Abuse Material
tldsBlock Top-Level Domains (TLDs)

Privacy

API FieldNextDNS Setting
blocklistsBlocklists (NextDNS, Steven Black, AdGuard, OISD, etc.)
nativesNative Tracking Protection (Windows, Apple, Samsung, etc.)
disguisedTrackersBlock Disguised Third-Party Trackers
allowAffiliateAllow Affiliate & Tracking Links

Parental Control

API FieldNextDNS Setting
servicesWebsites, Apps & Games (TikTok, Snapchat, Roblox, etc.)
categoriesCategories (Porn, Gambling, Dating, Piracy)
safeSearchSafeSearch
youtubeRestrictedModeYouTube Restricted Mode
blockBypassBlock Bypass Methods

Settings

API FieldNextDNS Setting
logsLogs (enabled, privacy adjustments, retention, location)
blockPageBlock Page
performancePerformance (EDNS Client Subnet, Cache Boost, CNAME Flattening)
bavBypass Age Verification
web3Web3 (ENS, Unstoppable Domains, Handshake, IPFS)

Other

SectionDescription
DenylistAll entries with active status
AllowlistAll entries with active status
RewritesAll custom DNS rewrites

Fields NOT Copied

These fields cannot be copied via the API and require manual configuration:

FieldNextDNS SettingReason
idProfile IDAuto-generated by NextDNS for new profile
fingerprintProfile fingerprintAuto-generated by NextDNS for new profile
setupSetup (DNS IPs, linked IP)Auto-generated by NextDNS for new profile
parentalControl.recreationRecreation TimeNot supported by API for write operations

Schema Validation

The tools validate the API response against known fields. If NextDNS adds new features, you'll see a warning:

WARNING: Unknown fields detected in API response!
This script may be outdated and missing new NextDNS features.
  - Unknown field(s) at 'security': newFeature

To proceed anyway, use the --force flag.

API Documentation

For more information about the NextDNS API, see the official API documentation.

Issues

Looking to contribute? Look for the Good First Issue label.

Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

See Bugs

License

MIT © Abhijith Vijayan