Skip to content

uninstall

The uninstall command performs a complete removal of NextDNS Blocker, including scheduled jobs, configuration files, and all data.

Terminal window
nextdns-blocker uninstall [OPTIONS]
OptionDescription
-y, --yesSkip confirmation prompt
--helpShow help message

Removes all automatic sync jobs:

  • macOS: Unloads and deletes launchd plist files
  • Linux: Removes cron entries
  • Windows: Deletes Task Scheduler tasks

Deletes the entire config directory containing:

  • .env file (API credentials)
  • config.json (domain configuration)
  • Any backup files

Default locations:

  • macOS/Linux: ~/.config/nextdns-blocker/
  • Windows: %APPDATA%\nextdns-blocker\

Deletes the data directory containing:

  • Audit logs
  • Cache files
  • Pending actions state

Default locations:

  • macOS/Linux: ~/.local/share/nextdns-blocker/
  • Windows: %LOCALAPPDATA%\nextdns-blocker\
Terminal window
nextdns-blocker uninstall

Output:

NextDNS Blocker Uninstall
-------------------------
This will permanently delete:
• Scheduled jobs (watchdog)
• Config: /Users/you/.config/nextdns-blocker
• Data: /Users/you/.local/share/nextdns-blocker
Are you sure you want to continue? [y/N]: y
Removing...
[1/3] Removing scheduled jobs...
Done
[2/3] Removing config directory...
Done
[3/3] Removing data directory...
Done
Uninstall complete!
To remove the package itself, run:
brew uninstall nextdns-blocker (Homebrew)
pipx uninstall nextdns-blocker (pipx)
pip uninstall nextdns-blocker (pip)

Skip the confirmation prompt:

Terminal window
nextdns-blocker uninstall --yes

After running uninstall, remove the package itself:

Terminal window
brew uninstall nextdns-blocker
Terminal window
pipx uninstall nextdns-blocker
Terminal window
pip uninstall nextdns-blocker

The uninstall command removes all NextDNS Blocker data, but:

  1. NextDNS account unchanged - Your NextDNS profile and denylist remain
  2. Domains still blocked - Manually added domains stay in NextDNS
  3. Package still installed - You need to remove it separately

Before uninstalling, you can clear all blocked domains:

Terminal window
# Edit config to empty blocklist
nextdns-blocker config edit
# Remove all entries from blocklist
# Run sync to remove from NextDNS
nextdns-blocker config push
# Then uninstall
nextdns-blocker uninstall

Or manually clear via NextDNS Dashboard.

To reinstall after uninstalling:

Terminal window
# Reinstall package
brew install nextdns-blocker # or pipx/pip
# Run setup wizard
nextdns-blocker init

You’ll need to reconfigure everything from scratch.

To save your configuration before uninstalling:

Terminal window
# Backup config
cp ~/.config/nextdns-blocker/config.json ~/nextdns-backup.json
cp ~/.config/nextdns-blocker/.env ~/nextdns-backup.env
# Uninstall
nextdns-blocker uninstall

For automated deployments:

#!/bin/bash
# Complete removal script
nextdns-blocker uninstall --yes
pip uninstall nextdns-blocker --yes
echo "NextDNS Blocker completely removed"
[2/3] Removing config directory...
Error: Permission denied

Solution: Check file ownership or run with appropriate permissions.

[1/3] Removing scheduled jobs...
Warning: Job not found

This is normal if the watchdog was never installed or was already removed.

If panic mode is active, the uninstall command still works. Panic mode state is stored locally and will be removed along with other data.

CodeMeaning
0Uninstall successful (or cancelled)
1Error during removal (partial uninstall)
CommandDescription
watchdog uninstallRemove only scheduled jobs
initSet up fresh installation
fixRepair without removing