NextDNS is a powerful DNS service that can block ads, trackers, malware and other unwanted domains before they reach your devices. On Windows, you can use the official NextDNS CLI instead of relying on a graphical application.
This guide explains what the NextDNS CLI does, how to install it on Windows 10 or Windows 11, how to deal with a common PowerShell execution-policy error, and how to verify that everything is working correctly.
What is NextDNS?
NextDNS is a cloud-based DNS resolver that adds privacy, security and customization to your internet connection. In addition to resolving domain names, it can block ads, trackers, malware, phishing websites and other unwanted domains.
- Encrypted DNS: Supports DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT).
- Ad and tracker blocking: Use configurable blocklists to block advertising and tracking domains.
- Threat protection: Helps protect against phishing, malware, cryptojacking and typosquatting.
- Parental controls and analytics: Supports features such as SafeSearch, website/app blocking and DNS query logs.
Official website:
nextdns.io
Dashboard:
my.nextdns.io
What is the NextDNS CLI?
The NextDNS CLI is a lightweight, open-source client for Windows, Linux, macOS and supported router platforms. On Windows, it runs as a system service in the background and forwards DNS queries to NextDNS.
Compared with a traditional graphical application, the CLI has several advantages:
- Low overhead: It runs quietly in the background without a dedicated graphical interface.
- Windows service: It can start automatically with Windows.
- Open source: The source code is publicly available on GitHub.
- Easy to automate: It can be managed from PowerShell or Command Prompt.
Prerequisites
Before installing the NextDNS CLI, make sure you have:
- Windows 10 or Windows 11.
- Administrator access to PowerShell.
- An active NextDNS account.
- Your six-character Configuration ID, available from your NextDNS dashboard.
Step 1: Open PowerShell as Administrator
Press the Windows key, search for PowerShell, right-click Windows PowerShell, and select Run as administrator.
You need an elevated PowerShell window because the installer needs to install and configure a Windows service.
Step 2: Download and Run the NextDNS Installer
Run the official NextDNS installation script:
iwr https://nextdns.io/install -OutFile $env:TEMP\n.ps1
& $env:TEMP\n.ps1The installer should download the appropriate NextDNS CLI package and then present an interactive menu.
Common Problem: PowerShell Says Script Execution Is Disabled
Depending on your Windows PowerShell execution-policy settings, the installer may fail with an error similar to:
This happens because PowerShell's Execution Policy can prevent scripts from running.
Temporary Fix for the Execution Policy Error
You do not need to permanently change your system-wide execution policy just to install NextDNS. Instead, you can temporarily bypass the policy for the current PowerShell process:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassWhen PowerShell asks for confirmation, press Y and Enter.
Then run the installer again:
iwr https://nextdns.io/install -OutFile $env:TEMP\n.ps1
& $env:TEMP\n.ps1-Scope Process. The policy change applies only to the current PowerShell process. Once you close that PowerShell window, the temporary policy change is gone.
Step 3: Install NextDNS
If the installer runs successfully, it will download the NextDNS CLI and display an installation menu.
Select 1) Install NextDNS.
The installer will then ask for your NextDNS Configuration ID. Enter the six-character ID from your NextDNS dashboard.
Once configured, the NextDNS CLI will run as a Windows service and use your selected NextDNS configuration.
Useful NextDNS Commands
After installation, you can manage the NextDNS service from an elevated PowerShell or Command Prompt window.
nextdns status
nextdns start
nextdns stop
nextdns restart
nextdns activate
nextdns deactivate
nextdns log
nextdns helpThese commands can be used for common tasks such as checking the service status, starting or stopping the service, restarting it, viewing DNS logs and displaying the available commands.
Verify That NextDNS Is Working
After configuring the CLI, open the following page in your browser:
The page displays diagnostic information about your DNS connection. A correctly configured NextDNS connection should indicate that the connection is using NextDNS and show information associated with your configuration.
Useful Links
- NextDNS official website
- NextDNS dashboard
- NextDNS CLI GitHub repository
- NextDNS CLI Windows documentation
- NextDNS community help center
Quick Installation Checklist
- Install Windows 10 or Windows 11 with administrator access.
- Open PowerShell as administrator.
- Run the official NextDNS installer.
- If PowerShell blocks the script, use the temporary Process-scope execution-policy bypass.
- Select Install NextDNS.
- Enter your six-character Configuration ID.
- Verify the connection at test.nextdns.io.
Conclusion
The NextDNS CLI provides a lightweight way to use NextDNS on Windows without running a dedicated graphical application. Installation is straightforward, and if PowerShell blocks the installer, a temporary Process-scope execution-policy bypass is usually enough to get past the error without permanently changing your PowerShell configuration.


