nextdns-skills / integrations
AGENTS.md4 starsChanged 4 months agoMITView on GitHub
Version 1.0.0 NextDNS Skills August 2026 Note: This document is mainly for agents and LLMs to follow when maintaining, generating, or refactoring NextDNS third-party platform integrations. Humans may also find it useful, but guidance here is optimized for automation and consistency by AI-assisted workflows. Best practices and guidelines for NextDNS third-party platform integrations, ordered by impact. Impact: MEDIUM Impact: MEDIUM (Deploy NextDNS on Asus routers with Merlin firmware) Installing NextDNS on Asus routers running Merlin firmware provides network-wide encrypted DNS…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/nextdns-api/AGENTS.mdAGENTS.md
- skills/nextdns-cli/AGENTS.mdAGENTS.md
- skills/nextdns-frontend/AGENTS.mdAGENTS.md
- skills/nextdns-ui/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- integrationsSkill
- nextdns-apiSkill
- nextdns-cliSkill
- nextdns-frontendSkill
- nextdns-uiSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
136 rules. About 0 are common, 115 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈115
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 99
JFFS Scripts: Ensure JFFS custom scripts are enabled in Administration -> System.
- Distinctive: line 107
If the installation fails, run the installer in debug mode:
- Distinctive: line 129
Corporate Networks: When IT policies block software installation or system-wide DNS changes
- Distinctive: line 135
Quick Setup: No system configuration or administrative access required
- Distinctive: line 137
Testing: Verify NextDNS configuration before deploying system-wide
- Distinctive: line 141
Browser-only: Only protects DNS queries from the browser itself, not other applications
- Distinctive: line 143
Per-browser: Must be configured separately in each browser
- Distinctive: line 215
After configuration, verify that DoH is working correctly:
- Very specific: line 235
Verify DNS queries are going to dns.nextdns.io
- Distinctive: line 239
Check the TRR (Trusted Recursive Resolver) status
- Distinctive: line 241
Should show as "TRR only" for Max Protection
- Distinctive: line 275
Always respect organizational policies when configuring DoH in managed environments.
- Very specific: line 283
Typo in URL: Ensure the URL is https://dns.nextdns.io/<config_id> (no trailing slash)
- Distinctive: line 293
If DNS queries fail after setting this invalid ID, your browser is correctly using DoH.
- Distinctive: line 297
If you see a warning that secure DNS is unavailable:
- Distinctive: line 299
Check if your network blocks port 443 to dns.nextdns.io
- Distinctive: line 307
If Firefox falls back to system DNS (when using "Increased Protection" mode):
- Distinctive: line 311
Verify the custom URL is entered correctly
- Distinctive: line 313
Check browser console (F12) for DNS-related errors
- Distinctive: line 343
Add the following parameters to your DNSMasq configuration to forward DNS queries to NextDNS while
- Very specific: line 361
When running NextDNS installation on such routers, use the -setup-router parameter:
- Distinctive: line 367
Use alternative port: Always configure NextDNS to use a non-standard port (for example, 5555) when
- Very specific: line 371
Preserve client information: Ensure --add-mac and --add-subnet parameters are set to
- Distinctive: line 379
Verify forwarding: Test DNS resolution after configuration to ensure queries are properly
- Distinctive: line 387
If you encounter port binding errors, verify that:
- Distinctive: line 393
No other services are using the chosen alternative port
- Distinctive: line 395
If client devices are not appearing correctly in NextDNS analytics:
- Very specific: line 397
Verify --add-mac parameter is enabled in DNSMasq configuration
- Very specific: line 399
Check that --add-subnet parameter is properly configured
- Distinctive: line 401
Ensure DNS queries are being forwarded to NextDNS (check DNSMasq logs)
- Very specific: line 403
If -setup-router fails or doesn't configure properly:
- Distinctive: line 407
Check router firmware documentation for DNSMasq configuration location
- Distinctive: line 409
Ensure you have appropriate permissions to modify DNSMasq configuration
- Distinctive: line 609
Check Enable in the SSH Server section.
- Distinctive: line 663
If the Applications menu is not visible, update your firmware first via System → Upgrade.
- Distinctive: line 681
After any firmware update:
- Distinctive: line 703
Before setting up the integration, you need:
- Very specific: line 781
Use
127.0.0.1:5300: instead of :53 to avoid conflicts with existing node DNS services. - Very specific: line 787
Separate profiles per namespace: Use dnsPolicy: None on pods that need a different NextDNS
- Distinctive: line 795
Solution: Verify the DaemonSet pods are running and NextDNS is listening on the configured port:
- Distinctive: line 1052
Deploy to groups, not all devices: Start with a pilot group (for example, IT department) before
- Distinctive: line 1056
Include the Root CA in the same deployment: If you plan to enable the Block Page, push the
- Distinctive: line 1068
Solution: Remove the existing DNS profile first, or ensure the device is enrolled in your MDM
- Distinctive: line 1100
Certificate Name: Ensure the certificate was imported correctly and is visible in
- Very specific: line 1104
Ensure max-udp-packet-size is set to 4096 in /ip dns set.
- Distinctive: line 1106
Use RouterOS v7.x for significantly better DoH performance and stability compared to v6.x.
- Distinctive: line 1166
Automatic Reconnection: No manual intervention needed after device restart
- Distinctive: line 1168
No App Permissions: No privacy concerns from third-party applications
- Distinctive: line 1218
When prompted, tap Allow to download the profile
- Very specific: line 1240
If you have a .mobileconfig file from NextDNS:
- Distinctive: line 1280
If internet works, the issue is with the hostname
- Distinctive: line 1282
If it doesn't work, the issue is network-related
- Distinctive: line 1358
If the installation fails or encounters errors, run the installer in debug mode to generate detailed
- Very specific: line 1364
curl not found: Ensure curl is installed with opkg update && opkg install curl
- Distinctive: line 1366
Permission denied: Make sure you're running commands as root or with sufficient privileges
- Distinctive: line 1368
Port 53 conflict: Check if another DNS service (like dnsmasq) is already using port 53
- Distinctive: line 1398
Add the following configuration:
- Distinctive: line 1448
After configuration, verify that NextDNS is working correctly:
- Very specific: line 1450
Check DNS resolution: nslookup example.com 127.0.0.1
- Distinctive: line 1452
Verify NextDNS is being used:
- Distinctive: line 1458
Check the NextDNS logs:
- Distinctive: line 1462
Verify queries from your firewall are appearing in the logs
- Distinctive: line 1468
If NextDNS blocks a domain that uses a CNAME record, Unbound may still resolve the CNAME target
- Distinctive: line 1478
Consider using Method 2 (CLI) if this limitation affects your use case
- Distinctive: line 1480
Test your blocking rules after configuration to verify expected behavior
- Distinctive: line 1616
Use DNS over HTTPS (DoH) or DNS over TLS (DoT) whenever possible for encrypted DNS queries
- Distinctive: line 1620
Always set bootstrap DNS servers in AdGuard Home to avoid ECS issues
- Very specific: line 1622
Use load-balanced endpoints (dns1 and dns2) for better reliability in AdGuard Home
- Distinctive: line 1624
Test DNS configuration after setup using online DNS leak test tools
- Distinctive: line 1630
IPv6 Only: Ensure both IPv4 and IPv6 are configured on dual-stack networks
- Very specific: line 1662
DNS over TLS: Use tls://dns1.nextdns.io/ and tls://dns2.nextdns.io/
- Very specific: line 1664
DNS over QUIC: Use quic://dns1.nextdns.io/ and quic://dns2.nextdns.io/
- Distinctive: line 1678
Verify DNS server addresses are entered correctly
- Distinctive: line 1680
Check firewall rules allow DNS traffic (port 53, 443 for DoH, 853 for DoT)
- Very specific: line 1682
Test with nslookup or dig commands
- Distinctive: line 1686
Ensure bootstrap DNS servers are configured
- Distinctive: line 1688
Verify network connectivity to NextDNS endpoints
- Distinctive: line 1690
Check AdGuard Home logs for upstream DNS errors
- Distinctive: line 1696
Verify AdGuard Home upstream configuration uses hostnames (not IP addresses)
- Distinctive: line 1736
After saving, devices that renew their DHCP lease will automatically use the Pi for DNS.
- Distinctive: line 1744
If the Pi is offline, devices will fall back to the Secondary DNS set in your router (Quad9 in the
- Very specific: line 1768
Use the Setup tab in my.nextdns.io as the source of truth for a profile's endpoints, then
- Distinctive: line 1800
Start with platform capability: Use a native encrypted transport when available.
- Distinctive: line 1816
Keep fallback explicit: If a non-NextDNS resolver is configured for availability, document
- Distinctive: line 1874
Use DoH for software that accepts a resolver URL and DoT for software that accepts a provider
- Distinctive: line 1925
Avoid Linked IP for CGNAT, multi-WAN load balancing, or networks where the observed public IPv4
- Distinctive: line 1933
Check that the field expects the correct value type: DoH URL versus DoT hostname.
- Distinctive: line 1953
Use an approved alternative transport supported by the device and network policy.
- Distinctive: line 1955
Do not silently fall back to unencrypted DNS if the deployment requires encrypted DNS.
- Distinctive: line 1987
Check Enable SSH service
- Distinctive: line 2015
Check Enable SSH services
- Distinctive: line 2021
After installing NextDNS on your Synology device, configure your network to use it as the DNS
- Distinctive: line 2025
If you're using SRM as your router, configure DHCP to automatically assign the NextDNS-enabled
- Distinctive: line 2037
If you're using DSM as a local DNS server for your network:
- Distinctive: line 2067
After installation, verify that NextDNS is working:
- Distinctive: line 2073
If the installation fails or you encounter issues, run the installer in debug mode:
- Distinctive: line 2079
Solution: Follow Step 1 under "SRM Installation" to enable the admin user.
- Distinctive: line 2087
Check DHCP server configuration
- Distinctive: line 2089
Verify the Synology device has a static IP
- Distinctive: line 2137
Add your NextDNS IPv6 endpoint address
- Distinctive: line 2159
Option A: Use NextDNS exclusively for all DNS queries
- Distinctive: line 2161
Option B: Use another DNS provider and forgo NextDNS integration
- Distinctive: line 2169
After configuration, verify the integration is working:
- Distinctive: line 2175
Check the NextDNS logs to see queries from your Tailscale devices
- Distinctive: line 2181
Monitor Query Logs: Check NextDNS analytics to ensure queries are being routed correctly
- Distinctive: line 2183
Document Profile Assignments: Keep a reference of which tags use which NextDNS profiles
- Distinctive: line 2193
Wrong Endpoint Format: Ensure you use the IPv6 address from NextDNS Endpoints, not the DoH URL
- Distinctive: line 2201
No Fallback DNS: If NextDNS is unavailable, DNS resolution may fail completely (consider
- Distinctive: line 2205
Verify "Override local DNS" is enabled in Tailscale Admin Console
- Distinctive: line 2207
Check that the NextDNS IPv6 endpoint is correctly entered
- Very specific: line 2211
Test IPv6 connectivity: ping6 2a07:a8c0::1
- Distinctive: line 2215
Verify device tags are correctly assigned in Tailscale Admin Console
- Distinctive: line 2217
Check that profile IDs match your NextDNS dashboard
- Very specific: line 2219
Use tailscale status to confirm device tags
- Distinctive: line 2223
Verify the profile ID in your configuration is correct
- Distinctive: line 2225
Check if device metadata sharing is blocked by firewall rules
- Very specific: line 2239
If you prefer not to share device information with NextDNS, use the no-device-info attribute:
- Distinctive: line 2279
If installation fails, run the installer with debug output enabled:
- Distinctive: line 2283
If you encounter APT repository errors (common on older UDM firmware), the Debian Stretch
- Distinctive: line 2287
Prefer DNS Shield: when available (UniFi OS 3.0+) for better compatibility and update
- Distinctive: line 2291
Document Configuration: Keep notes on which method you're using and the profile ID
- Distinctive: line 2293
Test After Updates: Verify NextDNS functionality after UniFi firmware updates
- Distinctive: line 2295
Monitor Logs: Check NextDNS analytics regularly to ensure queries are being logged
- Distinctive: line 2299
Use CLI for Advanced Needs: Only use CLI method if you need features not available in DNS
- Distinctive: line 2311
Post-Update Testing: Always verify DNS after UniFi firmware updates
- Distinctive: line 2313
SSH Access: Ensure SSH remains enabled if you need to troubleshoot CLI installations
- Distinctive: line 2335
No SSH access required
- Distinctive: line 2345
Only available on UniFi OS 3.0+
- Distinctive: line 2375
Follow the interactive prompts to complete installation.
- Distinctive: line 2411
Verify the NextDNS service is running:
- Distinctive: line 2415
Verify your profile ID is correctly configured.
- Distinctive: line 2433
Check the NextDNS logs for recent queries from your network
- Distinctive: line 2441
Consider switching to DNS Shield (Method 1) if available on your firmware version
- Distinctive: line 2483
For maximum privacy: Use only NextDNS across multiple bootstrap IPs or DoH endpoints.
- Distinctive: line 2485
For maximum availability: Use NextDNS as primary and Quad9 (which also blocks malware) as
- Distinctive: line 2513
After verifying the import in the NextDNS dashboard:
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NextDNS Integrations
Version 1.0.0
NextDNS Skills
August 2026
Note:
This document is mainly for agents and LLMs to follow when maintaining,
generating, or refactoring NextDNS third-party platform integrations. Humans
may also find it useful, but guidance here is optimized for automation
and consistency by AI-assisted workflows.
Abstract
Best practices and guidelines for NextDNS third-party platform integrations, ordered by impact.
Table of Contents
- Capability rules — MEDIUM
- 1.1 AsusWRT-Merlin Integration
- 1.2 Browser Native DoH Configuration
- 1.3 DNSMasq Integration
- 1.4 Docker Compose Deployment
- 1.5 EdgeRouter and Firewalla Integration
- 1.6 GL.iNet Router Integration
- 1.7 Home Assistant Integration
- 1.8 Kubernetes Integration
- 1.9 MDM Deployment (Jamf, Intune, Apple Configurator)
- 1.10 MikroTik DoH Setup
- 1.11 Mobile Native Encrypted DNS Configuration
- 1.12 OpenWrt Integration
- 1.13 pfSense and OPNsense Integration
- 1.14 Public DNS and AdGuard Home Integration
- 1.15 Raspberry Pi Integration
- 1.16 Select a NextDNS transport and setup method
- 1.17 Synology Integration (DSM and SRM)
- 1.18 Tailscale Integration
- 1.19 Ubiquiti (UniFi) Integration
- Efficiency rules — HIGH
- 2.1 Backup and Failover Configuration
- 2.2 Pi-hole to NextDNS Migration
1. Capability rules
Impact: MEDIUM
1.1 AsusWRT-Merlin Integration
Impact: MEDIUM (Deploy NextDNS on Asus routers with Merlin firmware)
Installing NextDNS on Asus routers running Merlin firmware provides network-wide encrypted DNS with
Installing NextDNS on Asus routers running Merlin firmware provides network-wide encrypted DNS with
client identification.
Enable SSH Access:
- Log in to your router's web interface.
- Navigate to Administration -> System.
- Set Enable SSH to
LAN only. - Click Apply.
Connect via SSH:
ssh admin@192.168.1.1Run Installer:
sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/master/install.sh)"Follow Prompts:
- Enter your Profile ID.
- Enable Setup Router when asked.
- Enable Report Client Info to see device names in logs.
For the best experience on AsusWRT-Merlin:
JFFS Scripts: Ensure JFFS custom scripts are enabled in Administration -> System. The
installer handles this, but it must stay enabled.
DNSSEC: Disable the built-in DNSSEC in the Asus GUI if you enable it in NextDNS to avoid
redundant processing.
If the installation fails, run the installer in debug mode:
1.2 Browser Native DoH Configuration
Impact: MEDIUM (Configuring DNS-over-HTTPS directly in browsers enables encrypted DNS without system-wide changes or requiring administrator privileges. Without this guidance, users in restricted environments may be unable to leverage NextDNS protection when software installation is blocked.)
Enables NextDNS protection in restricted environments without system-wide changes or administrative
Enables NextDNS protection in restricted environments without system-wide changes or administrative
privileges
Modern browsers include built-in support for DNS-over-HTTPS (DoH), allowing encrypted DNS queries
without installing additional software or requiring system administrator rights. This is
particularly useful in corporate, educational, or restrictive network environments.
- Corporate Networks: When IT policies block software installation or system-wide DNS changes
- Shared Computers: Public libraries, internet cafes, or shared workstations
- Restrictive Firewalls: Networks that block standard DNS (port 53) but allow HTTPS (port 443)
- Quick Setup: No system configuration or administrative access required
- Testing: Verify NextDNS configuration before deploying system-wide
- User-Specific Protection: Different users on the same computer can have different DNS settings
- Browser-only: Only protects DNS queries from the browser itself, not other applications
- Per-browser: Must be configured separately in each browser
- Profile-dependent: Settings may not sync across devices unless using browser sync
Google Chrome and Microsoft Edge share the same Chromium-based architecture and use identical
configuration steps.
Open browser settings:
- Chrome:
chrome://settings/security - Edge:
edge://settings/privacy
- Chrome:
Navigate to:
- Privacy and security → Security
- Scroll to Advanced section
- Locate Use secure DNS setting
- Enable the toggle switch
- Select With: Custom
Enter your NextDNS DoH URL:
https://dns.nextdns.io/<config_id>Replace<config_id>with youractual NextDNS Configuration ID
- Click Save or close settings (changes apply automatically)
- Log in to https://my.nextdns.io
- Select your configuration
- Your Configuration ID is displayed in the URL:
https://my.nextdns.io/<config_id>/setup - The ID is a 6-character alphanumeric string (for example,
abc123)
Firefox has its own implementation of DNS-over-HTTPS with slightly different terminology.
Open browser settings:
- Navigate to
about:preferences#privacy - Or go to Settings → Privacy and Security
- Navigate to
- Scroll to DNS over HTTPS section
Select Max Protection (recommended)
- Alternative: Increased Protection (falls back to regular DNS if DoH fails)
- In the dropdown, select Custom
Enter your NextDNS DoH URL:
https://dns.nextdns.io/<config_id>Replace<config_id>with youractual NextDNS Configuration ID
- Changes apply automatically
| Mode | Behavior | Use Case |
| ------------------------ | ----------------------------------- | --------------------------------------- |
| Max Protection | Always use DoH, fail if unavailable | Best security, recommended |
| Increased Protection | Use DoH, fallback to regular DNS | Compatibility with problematic networks |
| Off | Disable DoH | Troubleshooting only |
After configuration, verify that DoH is working correctly:
- Visit https://test.nextdns.io
You should see:
- ✓ Protocol: HTTPS (DoH)
- ✓ Status: Connected
- ✓ Configuration ID: Your config ID
- Open DevTools (F12)
- Navigate to Network tab
- Filter by Type: DNS
- Reload a webpage
- Verify DNS queries are going to
dns.nextdns.io - Type
about:networking#dnsin the address bar - Check the TRR (Trusted Recursive Resolver) status
- Should show as "TRR only" for Max Protection
- Log in to https://my.nextdns.io
- Navigate to Logs tab
- Browse the web and verify queries appear in real-time
- Use Max Protection (Firefox) or enable DoH unconditionally (Chrome/Edge) for maximum security
- Verify configuration using test.nextdns.io after setup
- Monitor Logs in NextDNS dashboard to ensure queries are being received
- Document Settings for easier reconfiguration on new devices
- Consider System-Wide Setup for comprehensive protection beyond just browser traffic
Browser DoH only protects DNS queries originating from that browser. Other applications on your
system (email clients, games, system updates, and more) will use the system's default DNS settings.
DoH adds minimal latency (typically 5-15ms) compared to unencrypted DNS. This is generally
imperceptible for normal browsing.
Some corporate or school networks may:
- Block DoH traffic entirely
- Require using specific DNS servers for policy enforcement
- Monitor DNS queries for security purposes
Always respect organizational policies when configuring DoH in managed environments.
Possible causes:
- Incorrect Configuration ID: Double-check your ID from the NextDNS dashboard
- Typo in URL: Ensure the URL is
https://dns.nextdns.io/<config_id>(no trailing slash) - Network Blocking: Some networks may block DoH traffic (port 443 to dns.nextdns.io)
- Browser Sync Conflict: Disable browser sync temporarily to rule out conflicts
Temporarily use an invalid configuration ID to verify the browser is actually using DoH:
https://dns.nextdns.io/invalid
If DNS queries fail after setting this invalid ID, your browser is correctly using DoH. Restore your
real configuration ID to resume normal operation.
If you see a warning that secure DNS is unavailable:
- Check if your network blocks port 443 to dns.nextdns.io
- Try temporarily disabling browser extensions that modify network traffic
- Clear browser cache and DNS cache
- Restart the browser
If Firefox falls back to system DNS (when using "Increased Protection" mode):
- Switch to "Max Protection" mode to prevent fallback
- Verify the custom URL is entered correctly
- Check browser console (F12) for DNS-related errors
1.3 DNSMasq Integration
Impact: MEDIUM (Running DNSMasq alongside NextDNS without proper configuration can result in loss of client reporting and conditional configuration features. This guidance ensures both services work together seamlessly while maintaining full NextDNS functionality.)
Enables DNSMasq and NextDNS to run together while preserving client reporting and conditional
Enables DNSMasq and NextDNS to run together while preserving client reporting and conditional
configuration capabilities
DNSMasq is a lightweight DNS forwarder commonly bundled with router firmwares. It is possible to run
DNSMasq and NextDNS together on the same system while maintaining full NextDNS functionality,
including client reporting and conditional configuration features.
This integration allows DNSMasq to continue handling local DNS resolution and DHCP services while
forwarding external DNS queries to NextDNS for filtering and protection.
NextDNS must be configured to listen on a different port to avoid conflicts with DNSMasq, which
typically uses port 53.
This configuration ensures NextDNS binds to port 5555 instead of the default port 53, allowing
DNSMasq to continue operating on port 53.
Add the following parameters to your DNSMasq configuration to forward DNS queries to NextDNS while
preserving client information:
These parameters ensure that:
--server=127.0.0.1#5555: All DNS queries are forwarded to NextDNS running on port 5555--add-mac: Client MAC addresses are included in DNS queries, enabling device identification--add-subnet=32,128: Client subnet information is added for IPv4 (/32) and IPv6 (/128),supporting conditional configuration
On router firmwares that ship with DNSMasq pre-installed, the above configuration can often be
handled automatically.
When running NextDNS installation on such routers, use the -setup-router parameter:
The -setup-router flag automatically detects DNSMasq and configures both services to work together
without manual intervention. This is the recommended approach for router environments.
Use alternative port: Always configure NextDNS to use a non-standard port (for example, 5555) when
running alongside DNSMasq
Preserve client information: Ensure
--add-macand--add-subnetparameters are set tomaintain client reporting features
Prefer automatic setup: On router firmwares, use
-setup-routerparameter for automaticconfiguration
Verify forwarding: Test DNS resolution after configuration to ensure queries are properly
forwarded to NextDNS
Check logs: Monitor both DNSMasq and NextDNS logs to verify proper operation and client
identification
If you encounter port binding errors, verify that:
- DNSMasq is running on port 53
- NextDNS is configured to use an alternative port (for example, 5555)
- No other services are using the chosen alternative port
If client devices are not appearing correctly in NextDNS analytics:
- Verify
--add-macparameter is enabled in DNSMasq configuration - Check that
--add-subnetparameter is properly configured - Ensure DNS queries are being forwarded to NextDNS (check DNSMasq logs)
If -setup-router fails or doesn't configure properly:
- Fall back to manual configuration using Steps 1 and 2
- Check router firmware documentation for DNSMasq configuration location
- Ensure you have appropriate permissions to modify DNSMasq configuration
- NextDNS CLI - DNSMasq
1.4 Docker Compose Deployment
Impact: MEDIUM (Without network_mode: host on Linux, all DNS clients appear as a single Docker NAT IP, breaking per-device identification and conditional profiles)
Deploy NextDNS CLI as a Docker Compose service with persistent configuration and host networking
Deploy NextDNS CLI as a Docker Compose service with persistent configuration and host networking
Docker Compose provides a declarative way to run NextDNS CLI in production environments alongside
other containerised services. Using network_mode: host on Linux is critical for correct operation
— it allows the container to see real client IP addresses and enables per-device identification and
conditional profiles.
Use
network_mode: hoston Linux: This is the only way to obtain real client IPs and enableper-device identification.
Mount
/etc/nextdnsas a volume: This preserves your configuration file across containerrecreations and image updates.
Use
restart: unless-stopped: Ensures the container starts on boot and after crashes, butrespects manual
docker stopcommands.Pin image version for production: Replace
latestwith a specific version tag (for example,nextdns/nextdns:1.42.0) to prevent unexpected breakage from image updates.- NextDNS CLI Docker Hub
- NextDNS CLI Wiki — Docker
- Docker Compose Documentation
Correct: Minimal Compose file (Linux)
# ✅ docker-compose.yml — Linux host, recommended configuration
services:
nextdns:
image: nextdns/nextdns:latest
container_name: nextdns
network_mode: host
restart: unless-stopped
command: run -profile abc123 -listen :53 -report-client-info
volumes:
- /etc/nextdns:/etc/nextdns # Persist configurationCorrect:
# ✅ Start the service
docker compose up -d
# ✅ View logs
docker compose logs -f nextdns
# ✅ Check status
docker compose exec nextdns nextdns statusCorrect: Full production Compose file with environment variable
# ✅ Production configuration with profile ID from environment
services:
nextdns:
image: nextdns/nextdns:latest
container_name: nextdns
network_mode: host
restart: unless-stopped
environment:
- NEXTDNS_PROFILE=${NEXTDNS_PROFILE_ID}
command: >
run
-profile ${NEXTDNS_PROFILE_ID}
-listen :53
-report-client-info
-cache-size 10MB
-max-ttl 5s
volumes:
- nextdns-config:/etc/nextdns
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
nextdns-config:Correct:
# ✅ .env file (gitignored)
NEXTDNS_PROFILE_ID=abc123Correct: Port-mapped Compose file (macOS/Windows Docker Desktop)
# ✅ docker-compose.yml — macOS / Windows fallback
services:
nextdns:
image: nextdns/nextdns:latest
container_name: nextdns
restart: unless-stopped
ports:
- "53:53/udp"
- "53:53/tcp"
command: run -profile abc123 -listen :53
volumes:
- nextdns-config:/etc/nextdns
volumes:
nextdns-config:Correct: Multi-profile setup (different subnets)
# ✅ Advanced: multiple profiles for multiple network segments
services:
nextdns:
image: nextdns/nextdns:latest
container_name: nextdns
network_mode: host
restart: unless-stopped
command: >
run
-profile 10.0.1.0/24=PROFILE_HOME
-profile 10.0.2.0/24=PROFILE_KIDS
-profile PROFILE_DEFAULT
-listen :53
-report-client-info
volumes:
- nextdns-config:/etc/nextdns
volumes:
nextdns-config:Correct: Management commands
# ✅ Update to the latest NextDNS image
docker compose pull nextdns
docker compose up -d nextdns
# ✅ Reload configuration without downtime
docker compose restart nextdns
# ✅ View real-time DNS query logs
docker compose exec nextdns nextdns log
# ✅ Check cache statistics
docker compose exec nextdns nextdns cache-statsIncorrect:
# ❌ Using bridge networking instead of host on Linux
services:
nextdns:
image: nextdns/nextdns:latest
ports:
- "53:53/udp" # ❌ On Linux, use network_mode: host insteadIncorrect:
# ❌ No restart policy — service stops permanently on crash or reboot
services:
nextdns:
image: nextdns/nextdns:latest
# ❌ Missing: restart: unless-stopped1.5 EdgeRouter and Firewalla Integration
Impact: MEDIUM (Deploy NextDNS on professional gateways like EdgeOS and Firewalla)
Strategic deployment of NextDNS on Ubiquiti EdgeRouter (EdgeOS) and Firewalla hardware.
Strategic deployment of NextDNS on Ubiquiti EdgeRouter (EdgeOS) and Firewalla hardware.
- Go to System tab (bottom left).
- Check Enable in the SSH Server section.
- Click Save.
Firewalla runs a customized Ubuntu-based OS. You can install the CLI directly on the box.
- In the Firewalla app: Settings -> Advanced -> Configurations -> SSH Server.
- Note the password.
✅ Client Reporting: Always enable Discovery DNS and MDNS in the NextDNS CLI configuration
to ensure Firewalla/EdgeRouter can map internal IP addresses to hostnames in your NextDNS dashboard.
❌ Port Conflicts: Ensure no other service is listening on port 53. On EdgeRouter, the NextDNS
installer typically handles dnsmasq integration automatically.
1.6 GL.iNet Router Integration
Impact: HIGH (GL.iNet routers ship with AdGuard Home enabled — installing NextDNS CLI without disabling it causes port conflicts and unreliable DNS for all network clients)
Install NextDNS CLI on GL.iNet routers by first disabling the pre-installed AdGuard Home
Install NextDNS CLI on GL.iNet routers by first disabling the pre-installed AdGuard Home
GL.iNet produces a range of portable and home routers (Beryl AX, Slate AX, Flint 2, Mango, and
more) that run a customised OpenWrt firmware with a polished web UI. They are popular as travel
routers and home network devices.
The critical issue: GL.iNet firmware bundles AdGuard Home as a built-in DNS filter and enables
it by default. AdGuard Home and NextDNS CLI both need port 53 — they cannot run simultaneously
without explicit port coordination.
- Connect to the router's Wi-Fi or Ethernet
- Open
http://192.168.8.1in a browser - Log in with your admin credentials
- Navigate to Applications → AdGuard Home in the left sidebar
- Toggle the switch to Disabled
- Click Apply
If the Applications menu is not visible, update your firmware first via System → Upgrade.
- Navigate to System → Advanced → SSH (or System → SSH on older firmware)
- Enable SSH Access on port 22
- Optionally restrict to LAN only for security
During installation:
- Set your Profile ID
- Choose Yes for router setup (integrates with dnsmasq)
- Choose Yes for client info reporting (enables device names in dashboard)
GL.iNet firmware updates often re-enable AdGuard Home and may remove the NextDNS CLI installation.
After any firmware update:
1.7 Home Assistant Integration
Impact: MEDIUM (Without this integration guidance, users cannot leverage Home Assistant for automated DNS control and monitoring. This prevents the creation of time-based parental controls, smart blocking rules, and real-time analytics tracking for home automation systems.)
Enables automated DNS control and monitoring through Home Assistant smart home platform
Enables automated DNS control and monitoring through Home Assistant smart home platform
Home Assistant is a popular open-source home automation platform that can integrate with NextDNS to
provide smart DNS control and monitoring. This integration allows you to automate DNS settings based
on time, location, or other triggers, and provides real-time visibility into network activity.
Before setting up the integration, you need:
- API Key: Generate from NextDNS Account Settings
- Profile ID: Located in your NextDNS profile settings (format:
abc123)
- Navigate to Settings → Devices and Services in Home Assistant
- Click Add Integration and search for "NextDNS"
- Enter your NextDNS API Key and Profile ID
- The integration will automatically discover and configure available entities
The integration provides multiple entity types for monitoring and control:
- Connection Status: Indicates whether NextDNS is actively connected and responding
- Clear Logs: Instantly clear all DNS query logs for the profile
- Blocked Queries: Total count of blocked DNS queries
- Query Ratios: Percentage breakdown of blocked vs. allowed queries
- Protocol Statistics: Distribution of DNS queries by protocol (DoH, DoT, UDP, TCP)
- Encryption Status: Count of encrypted vs. unencrypted queries
Control various NextDNS features through boolean switches:
- AI Threat Detection: Toggle real-time threat intelligence
- Parental Controls: Enable/disable content filtering categories
Blocklist Controls: Individual switches for specific services:
- Block TikTok
- Block Facebook
- Block Tinder
- Block Social Networks (aggregate)
- Block Gaming platforms
- Block Dating apps
This automation demonstrates blocking social media for children during evening hours:
Complement the evening block with a morning unblock:
Automatically clear logs when a high number of threats are detected:
1.8 Kubernetes Integration
Impact: HIGH (Without proper DNS policy configuration, pods bypass NextDNS filtering entirely)
Deploy NextDNS CLI in a Kubernetes cluster as a node-level DNS proxy
Deploy NextDNS CLI in a Kubernetes cluster as a node-level DNS proxy
Running NextDNS in Kubernetes requires deploying the CLI as a DaemonSet so every node gets a local
DNS proxy. Pods then route DNS queries through the node-local NextDNS instance either via
dnsPolicy: None or by configuring CoreDNS as an upstream forwarder.
Two approaches are covered:
- DaemonSet + dnsPolicy per Pod — pods explicitly use the node IP as their nameserver.
CoreDNS Forwarder — CoreDNS forwards all or specific queries to the node-local NextDNS
daemon, requiring no pod-level changes.
- Use
127.0.0.1:5300instead of:53to avoid conflicts with existing node DNS services. - Always add
NET_ADMINcapability: NextDNS CLI needs it to configure system-level DNS. - Use
hostNetwork: true: Ensures the DaemonSet container shares the node network namespace. Separate profiles per namespace: Use
dnsPolicy: Noneon pods that need a different NextDNSprofile from the cluster default.
- Monitor with
nextdns log: Exec into a DaemonSet pod to inspect DNS query logs.
Symptoms: DNS queries time out or return SERVFAIL after applying the CoreDNS forwarder.
Solution: Verify the DaemonSet pods are running and NextDNS is listening on the configured port:
Symptoms: Changes to the Corefile are not taking effect.
Solution: Force a CoreDNS rollout restart after ConfigMap changes:
Correct: Daemonset manifest
# ✅ nextdns-daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nextdns
namespace: kube-system
labels:
app: nextdns
spec:
selector:
matchLabels:
app: nextdns
template:
metadata:
labels:
app: nextdns
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
tolerations:
- effect: NoSchedule
operator: Exists
containers:
- name: nextdns
image: nextdns/nextdns:latest
args:
- run
- -profile
- abc123
- -listen
- 127.0.0.1:5300
- -report-client-info
securityContext:
capabilities:
add: [NET_ADMIN]
resources:
requests:
cpu: 10m
memory: 32Mi
limits:
cpu: 100m
memory: 64MiApply:
Correct:
kubectl apply -f nextdns-daemonset.yamlCorrect: Pod-level DNS configuration
# ✅ Pod spec with explicit NextDNS nameserver
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
dnsPolicy: None
dnsConfig:
nameservers:
- 127.0.0.1 # node-local NextDNS proxy
searches:
- default.svc.cluster.local
- svc.cluster.local
- cluster.local
options:
- name: ndots
value: '5'
containers:
- name: my-app
image: my-app:latestCorrect: CoreDNS forwarder (cluster-wide)
# ✅ Edit CoreDNS ConfigMap
kubectl edit configmap coredns -n kube-systemUpdate the Corefile:
Correct:
# ✅ Forward all non-cluster traffic to node-local NextDNS
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus :9153
forward . 127.0.0.1:5300 {
max_concurrent 1000
}
cache 30
loop
reload
loadbalance
}Restart CoreDNS to apply:
Correct:
kubectl rollout restart deployment coredns -n kube-systemIncorrect:
# ❌ hostPort without hostNetwork — DNS on port 53 requires hostNetwork: true
spec:
containers:
- name: nextdns
ports:
- containerPort: 53
hostPort: 53 # ❌ Unreliable without hostNetwork: trueIncorrect:
# ❌ Running as root without NET_ADMIN capability — service will fail to configure DNS
securityContext:
runAsUser: 0 # ❌ Must also add NET_ADMIN capability1.9 MDM Deployment (Jamf, Intune, Apple Configurator)
Impact: HIGH (Manual per-device DNS configuration is error-prone at scale — MDM deployment ensures 100% fleet coverage and prevents employees from disabling DNS filtering)
Deploy NextDNS DNS configuration to an entire device fleet via MDM without manual per-device setup
Deploy NextDNS DNS configuration to an entire device fleet via MDM without manual per-device setup
For organisations managing tens or hundreds of devices, MDM (Mobile Device Management) is the only
scalable way to enforce DNS filtering. Instead of configuring each device manually, you push a DNS
profile to the entire fleet — or to specific groups — from a central management console.
This rule covers:
Apple devices (iOS, iPadOS, macOS) via Jamf Pro, Jamf School, Apple Configurator 2, or Microsoft
Intune
- Windows devices via Microsoft Intune (encrypted DNS policy)
Apple's DNS configuration uses .mobileconfig profiles. NextDNS generates these profiles for you.
- Log in to
https://my.nextdns.io/{profile-id}/setup - Select Apple from the platform list
- Click Download Configuration Profile — this generates a signed
.mobileconfigfile
Or generate via the API:
- In Jamf Pro, navigate to Computers / Devices → Configuration Profiles
- Click + New
- Under General, set the profile name (for example, "NextDNS DNS Filter")
- Click + Add → search for DNS Settings (macOS) or navigate to Custom Settings (iOS)
- For iOS/iPadOS: use Custom Payload → upload the NextDNS
.mobileconfigpayload content - Set Distribution Method to Automatic for automatic push to targeted devices
- Set the Scope to the devices or groups that should receive the profile
- Click Save
For macOS via Jamf's built-in DNS settings:
- Connect device(s) to Mac running Apple Configurator 2
- Select the device(s) in the organiser
- Choose Actions → Add → Profiles
- Select the downloaded
nextdns.mobileconfigfile - Click Add — the profile is pushed silently without user confirmation on supervised devices
- Navigate to Devices → Configuration Profiles → Create Profile
- Platform: iOS/iPadOS or macOS
- Profile type: Templates → Custom
- Upload the NextDNS
.mobileconfigfile - Assign to the target group
- Click Review + Create
For supervised devices (corporate-owned), mark the profile as non-removable:
In the .mobileconfig file, set:
This prevents users from removing the DNS configuration from **Settings → VPN and Device
Management**.
Windows 11 supports encrypted DNS (DoH) via Group Policy or Intune Settings Catalog.
- Navigate to Devices → Configuration Profiles → Create Profile
- Platform: Windows 10 and later
- Profile type: Settings Catalog
- Click + Add Settings and search for "DNS over HTTPS"
- Configure:
- Assign to the Windows device group
- Click Review + Create
Use supervised/enrolled devices for the strongest enforcement — unsupervised devices can
remove profiles.
- Set
PayloadRemovalDisallowed: truefor corporate devices where DNS filtering is mandatory. Deploy to groups, not all devices: Start with a pilot group (for example, IT department) before
rolling out to the entire fleet.
Include the Root CA in the same deployment: If you plan to enable the Block Page, push the
NextDNS Root CA as a separate configuration profile in the same Jamf/Intune deployment.
Test with one device first: Validate that the profile does not break any business-critical
applications before fleet-wide deployment.
Cause: The device is not supervised, or there is already a DNS profile installed from another
MDM.
Solution: Remove the existing DNS profile first, or ensure the device is enrolled in your MDM
as supervised.
Symptoms: nslookup still uses plain DNS after applying the Intune policy.
Solution: Force a policy sync:
- Apple — DNS Settings payload
- Jamf Pro Documentation
- Microsoft Intune — Custom profiles
- NextDNS Dashboard — Setup
1.10 MikroTik DoH Setup
Impact: HIGH (Ensures secure DNS on MikroTik routers via DNS-over-HTTPS (DoH))
Comprehensive guide for configuring NextDNS with DNS-over-HTTPS on MikroTik RouterOS devices.
Comprehensive guide for configuring NextDNS with DNS-over-HTTPS on MikroTik RouterOS devices.
MikroTik RouterOS (v6.47+) supports DNS-over-HTTPS (DoH). Configuring NextDNS via DoH provides
encrypted DNS for the entire network without relying on the command-line installer.
System Time: MikroTik MUST have the correct system time for HTTPS verification. Check
/system clock print.Certificate Name: Ensure the certificate was imported correctly and is visible in
/certificate print.
- Ensure
max-udp-packet-sizeis set to4096in/ip dns set. - Use RouterOS v7.x for significantly better DoH performance and stability compared to v6.x.
- MikroTik DNS Documentation
- NextDNS Setup Guide
Correct: 1. Import security certificate
# ✅ Import DigiCert Root CA (Required for dns.nextdns.io)
/tool fetch url=https://cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem
/certificate import file-name=DigiCertGlobalRootCA.crt.pem name=DigiCertGlobalRootCACorrect: 2. Configure static DNS
# ✅ Set static entries for the DoH hostname
/ip dns static
add address=45.90.28.0 name=dns.nextdns.io
add address=45.90.30.0 name=dns.nextdns.ioCorrect: 3. Enable DoH
# ✅ Configure DoH Server (Replace abc123 with your Profile ID)
/ip dns set use-doh-server=https://dns.nextdns.io/abc123 verify-doh-cert=yes
/ip dns set allow-remote-requests=yesIncorrect:
# ❌ Incorrect: Standard servers still present
/ip dns set servers=8.8.8.8,1.1.1.11.11 Mobile Native Encrypted DNS Configuration
Impact: HIGH (Native encrypted DNS support on mobile devices provides lightweight protection without battery-draining background apps. Without this guidance, users may unnecessarily install third-party apps when the OS provides built-in encrypted DNS capabilities.)
Enables NextDNS protection on mobile devices using built-in OS features without battery-draining
Enables NextDNS protection on mobile devices using built-in OS features without battery-draining
background apps
Modern mobile operating systems include native support for encrypted DNS protocols, eliminating the
need for third-party apps. This provides a lightweight, battery-efficient method for NextDNS
protection on smartphones and tablets.
- No Background Process: Zero battery impact from background services
- OS-Level Integration: More reliable than third-party apps
- System-Wide Protection: Covers all apps and system services
- Automatic Reconnection: No manual intervention needed after device restart
- No App Permissions: No privacy concerns from third-party applications
- Always Active: Cannot be accidentally closed or force-stopped
You need advanced features like:
- Custom DNS server selection per network
- Analytics and diagnostics on the device
- Detailed connection logs
- Manual profile switching
Android 9 (Pie) and later include Private DNS support using DNS-over-TLS (DoT).
- Open Settings on your Android device
Navigate to:
- Network and internet (or Connections on Samsung devices)
- Select Private DNS (or Advanced → Private DNS)
- Choose Private DNS provider hostname
Enter your NextDNS hostname:
<config_id>.dns.nextdns.ioReplace<config_id>with your actualNextDNS Configuration ID
- Tap Save
- Log in to https://my.nextdns.io
- Select your configuration
- Your Configuration ID is the 6-character alphanumeric code in the URL
iOS 14 and later support Encrypted DNS Profiles using DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT)
via signed configuration profiles.
- On your iOS device, visit https://my.nextdns.io
- Navigate to your configuration → Setup tab
- Select iOS from the platform list
- Tap Download Configuration Profile
- When prompted, tap Allow to download the profile
- Open Settings app (a notification will appear)
- Tap Profile Downloaded near the top of settings
Review the profile details:
- Name: NextDNS (your config name)
- Type: DNS Settings
- Signed by: NextDNS, Inc.
- Tap Install in the top right
- Enter your device passcode when prompted
- Tap Install again to confirm
- Tap Done when installation completes
If you have a .mobileconfig file from NextDNS:
- AirDrop or email the file to your iOS device
- Tap the file to open
- Follow steps 6-11 above
Stock Android:
Samsung: One UI
- Visit https://test.nextdns.io in your browser
You should see:
- ✓ Protocol: TLS (DoT)
- ✓ Status: Connected
- ✓ Configuration ID: Your config ID
Symptoms: Websites not loading, "Couldn't connect to server" errors
Solutions:
Check hostname format:
- Correct:
abc123.dns.nextdns.io - Incorrect:
https://abc123.dns.nextdns.io(no protocol) - Incorrect:
abc123.dns1.nextdns.io(wrong subdomain)
- Correct:
Test with automatic setting:
- Temporarily select Automatic
- If internet works, the issue is with the hostname
- If it doesn't work, the issue is network-related
Network restrictions:
- Some networks (corporate, public Wi-Fi) may block DNS-over-TLS (port 853)
- Try switching between Wi-Fi and mobile data
- Contact network administrator if on corporate network
- Clear DNS cache:
Settings → Apps → Show system apps → DNS Client → Storage → Clear cache
1.12 OpenWrt Integration
Impact: HIGH (Proper installation and configuration of NextDNS on OpenWrt routers ensures network-wide DNS protection. Without this guidance, users may struggle with installation methods, upgrades, or troubleshooting issues specific to OpenWrt environments.)
Essential for deploying NextDNS on OpenWrt routers with proper installation methods and
Essential for deploying NextDNS on OpenWrt routers with proper installation methods and
troubleshooting guidance
OpenWrt is a popular open-source firmware for routers that provides extensive customization and
control. This rule provides comprehensive guidance for installing, upgrading, and troubleshooting
NextDNS on OpenWrt devices.
OpenWrt supports two installation methods depending on your version and preferences.
This method works on all OpenWrt versions and provides the most reliable installation experience.
| Step | Action |
| ---- | ----------------------------------------------------------------------------------- |
| 1 | Enable SSH in the Web GUI: Navigate to System → Administration |
| 2 | Connect to your router via SSH |
| 3 | Install curl: opkg update && opkg install curl |
| 4 | Run the NextDNS installer: sh -c 'sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/master/install.sh)"' |
| 5 | Follow the on-screen instructions to complete setup |
This method is only available for OpenWrt version 19.07.01-rc2 and later. It provides a graphical
interface for configuration.
| Step | Action |
| ---- | -------------------------------------------------------- |
| 1 | Navigate to System → Software in the Web GUI |
| 2 | Click Update lists to refresh the package repository |
| 3 | Search for and install the luci-app-nextdns package |
| 4 | Configure NextDNS at Services → NextDNS |
To upgrade an existing NextDNS installation on OpenWrt:
Re-run the installer script:
sh -c 'sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/master/install.sh)"'The installer will detect the existing installation and offer an upgrade option if a new version
is available.
If the installation fails or encounters errors, run the installer in debug mode to generate detailed
logs:
This will output verbose information that can help identify the root cause of installation issues.
- curl not found: Ensure curl is installed with
opkg update && opkg install curl - Permission denied: Make sure you're running commands as root or with sufficient privileges
- Port 53 conflict: Check if another DNS service (like dnsmasq) is already using port 53
- Package not available: For Method B, verify your OpenWrt version is 19.07.01-rc2 or later
- NextDNS CLI - OpenWrt
1.13 pfSense and OPNsense Integration
Impact: HIGH (Proper configuration of NextDNS on pfSense and OPNsense firewalls enables network-wide DNS protection with encrypted DNS transport. Without this guidance, users may face CNAME chasing issues on pfSense or fail to leverage OPNsense's native DoT capabilities.)
Critical for deploying NextDNS on enterprise-grade firewalls with proper encrypted DNS configuration
Critical for deploying NextDNS on enterprise-grade firewalls with proper encrypted DNS configuration
and awareness of platform-specific limitations
pfSense and OPNsense are FreeBSD-based firewall/router platforms widely used in enterprise and home
environments. This rule provides platform-specific guidance for integrating NextDNS with their
native DNS resolvers.
pfSense uses Unbound as its DNS resolver. There are two methods to integrate NextDNS.
Configure Unbound to forward all DNS queries to NextDNS over TLS.
- Navigate to Services → DNS Resolver → General Settings
- Scroll to Custom Options section
- Add the following configuration:
- Replace
<config_id>with your actual NextDNS Configuration ID - Click Save and Apply Changes
**pfSense uses Unbound as a recursive resolver. Unbound chases CNAMEs by design, which can result in
unexpected behavior when used in conjunction with a blocking DNS resolver like NextDNS.**
OPNsense provides a dedicated user interface for DNS-over-TLS configuration, making it more
straightforward than pfSense.
OPNsense has a built-in UI for configuring DNS-over-TLS, which is the preferred method.
- Navigate to Services → Unbound DNS → DNS over TLS
- Click Add button
- Configure the following settings:
| Setting | Value |
| --------------- | --------------------------------- |
| Server IP | 45.90.28.0 or 45.90.30.0 |
| Server Port | 853 |
| Verify CN | <your_config_id>.dns.nextdns.io |
- Replace
<your_config_id>with your actual NextDNS Configuration ID - Click Save and Apply
| Feature | pfSense | OPNsense |
| ------------------------ | -------------------------------- | ------------------------- |
| DoT UI | ❌ Manual configuration required | ✅ Dedicated UI available |
| Configuration Method | Custom Options (YAML) | Web UI form |
| CNAME Chasing | ⚠️ Yes (known issue) | ⚠️ Yes (Unbound behavior) |
| CLI Support | ✅ Yes (FreeBSD) | ✅ Yes (FreeBSD) |
| Ease of Setup | Moderate | Easy |
After configuration, verify that NextDNS is working correctly:
- Check DNS resolution:
nslookup example.com 127.0.0.1 Verify NextDNS is being used:
- Visit https://test.nextdns.io
- You should see your Configuration ID and "✓ This device is using NextDNS"
Check the NextDNS logs:
- Navigate to your NextDNS dashboard
- Verify queries from your firewall are appearing in the logs
What this means:
- If NextDNS blocks a domain that uses a CNAME record, Unbound may still resolve the CNAME target
- This can bypass some of your blocking rules
- This is a known limitation of Unbound (see Unbound issue #132)
Mitigation:
- Be aware of this behavior when troubleshooting unexpected access to blocked domains
- Consider using Method 2 (CLI) if this limitation affects your use case
- Test your blocking rules after configuration to verify expected behavior
Install the NextDNS CLI directly on pfSense (FreeBSD-compatible).
Advantages:
- Avoids CNAME chasing issues
- Provides device-level analytics
- Better integration with NextDNS features
Why Verify CN matters:
- Ensures the connection is encrypted and authenticated
- Links the traffic to your specific NextDNS profile
- Prevents man-in-the-middle attacks
Repeat the steps above with the secondary server for redundancy:
| Setting | Value |
| --------------- | --------------------------------------------- |
| Server IP | 45.90.30.0 (if you used 45.90.28.0 above) |
| Server Port | 853 |
| Verify CN | <your_config_id>.dns.nextdns.io |
OPNsense also supports the CLI installer:
1.14 Public DNS and AdGuard Home Integration
Impact: HIGH (Without proper public DNS and AdGuard Home configuration, users may experience degraded performance, connectivity issues, or inability to leverage NextDNS features for unlinked devices and third-party DNS forwarders.)
Critical for unlinked device setup and AdGuard Home upstream configuration
Critical for unlinked device setup and AdGuard Home upstream configuration
NextDNS provides public DNS servers (anycast) that can be used for devices that cannot link to a
specific configuration profile, as well as integration with AdGuard Home as an upstream DNS
provider. This guide covers browser setup, operating system configuration, and AdGuard Home
integration patterns.
NextDNS operates the following public DNS servers for unlinked devices:
Configure secure DNS in Chromium-based browsers:
- Navigate to Settings
- Go to Privacy and security
- Select Security
- Enable Use secure DNS
- Select Custom provider
- Enter:
https://dns.nextdns.io/
Configure DNS over HTTPS in Firefox:
- Navigate to Settings
- Go to Privacy and Security
- Enable DNS over HTTPS
- Select Max Protection
- Choose NextDNS from the provider list
Configure DNS settings with DoH support:
- Open Settings
- Navigate to Network and internet
- Select your connection (Wi-Fi or Ethernet)
- Click Hardware properties
- Under DNS Server Assignment, click Edit
Set IPv4 DNS servers:
- Preferred:
45.90.28.0 - Alternate:
45.90.30.0
- Preferred:
Set IPv6 DNS servers:
- Preferred:
2a07:a8c0:: - Alternate:
2a07:a8c1::
- Preferred:
- Set DNS over HTTPS to On (manual template)
- Enter template:
https://dns.nextdns.io/
Configure Private DNS for system-wide encrypted DNS:
- Open Settings
- Navigate to Network and internet
- Select Private DNS
- Choose Private DNS provider hostname
- Enter:
dns.nextdns.io
iOS requires installing a configuration profile:
- Visit the Apple configuration generator
- Generate and download the
.mobileconfigprofile for your configuration - Install the profile on your iOS device
- Navigate to Settings → General → VPN and Device Management
- Select and install the NextDNS profile
Note: The profile must be generated from the official NextDNS Apple generator to ensure proper
signing and compatibility.
Configure NextDNS as upstream DNS in AdGuard Home for load balancing:
- Use DNS over HTTPS (DoH) or DNS over TLS (DoT) whenever possible for encrypted DNS queries
- Configure both IPv4 and IPv6 DNS servers for dual-stack networks
- Always set bootstrap DNS servers in AdGuard Home to avoid ECS issues
- Use load-balanced endpoints (
dns1anddns2) for better reliability in AdGuard Home - Test DNS configuration after setup using online DNS leak test tools
Missing Bootstrap DNS: AdGuard Home may fail to resolve NextDNS upstream servers without
proper bootstrap configuration
- IPv6 Only: Ensure both IPv4 and IPv6 are configured on dual-stack networks
- DoH Template Format: Windows 11 requires the full
https://URL format for DoH templates - iOS Profile Expiry: Configuration profiles may need to be reinstalled after iOS updates
- NextDNS Help Center
IPv4 Addresses:
- Primary:
45.90.28.0 - Secondary:
45.90.30.0
IPv6 Addresses:
- Primary:
2a07:a8c0:: - Secondary:
2a07:a8c1::
DNS over HTTPS: DoH
- Endpoint:
https://dns.nextdns.io/
DNS over TLS (DoT) / Android Private DNS:
- Hostname:
dns.nextdns.io
Recommended Configuration:
Alternative Protocols:
- DNS over TLS: Use
tls://dns1.nextdns.io/andtls://dns2.nextdns.io/ - DNS over QUIC: Use
quic://dns1.nextdns.io/andquic://dns2.nextdns.io/
Critical: Bootstrap DNS servers must be configured to ensure AdGuard Home can resolve NextDNS
upstream hostnames and maintain EDNS Client Subnet (ECS) functionality for optimal routing.
Recommended Bootstrap Servers:
These public resolvers ensure that AdGuard Home can properly resolve the NextDNS upstream hostnames
and maintain ECS functionality for optimal routing.
DNS Not Resolving:
- Verify DNS server addresses are entered correctly
- Check firewall rules allow DNS traffic (port 53, 443 for DoH, 853 for DoT)
- Test with
nslookupordigcommands
AdGuard Home Connection Issues:
- Ensure bootstrap DNS servers are configured
- Verify network connectivity to NextDNS endpoints
- Check AdGuard Home logs for upstream DNS errors
ECS Not Working:
- Confirm bootstrap DNS servers are set to public resolvers
- Verify AdGuard Home upstream configuration uses hostnames (not IP addresses)
1.15 Raspberry Pi Integration
Impact: HIGH (Without proper DHCP configuration pointing LAN devices to the Pi, NextDNS CLI runs on the Pi but provides no network-wide protection)
Deploy NextDNS CLI on a Raspberry Pi as a dedicated DNS server for your entire home network
Deploy NextDNS CLI on a Raspberry Pi as a dedicated DNS server for your entire home network
Running NextDNS CLI on a Raspberry Pi provides network-wide encrypted DNS filtering without
configuring each device individually. All DNS queries from every device on your network pass
through the Pi to NextDNS.
This is the most popular alternative to Pi-hole — you get powerful filtering without maintaining
local blocklists.
- Raspberry Pi running Raspberry Pi OS Bookworm/Bullseye or Ubuntu Server for ARM
- Pi connected to your network via Ethernet (recommended) or Wi-Fi
- Router admin access to change DHCP DNS settings
- A static IP for the Pi
Configure your router to always assign the same IP to the Pi via DHCP reservation (preferred):
- Log into your router admin panel
- Find the DHCP reservations / static leases section
- Find the Pi's MAC address and assign it
192.168.1.2(or your preferred IP)
Answer the installer prompts:
In your router's DHCP settings, set the DNS server to the Pi's IP:
After saving, devices that renew their DHCP lease will automatically use the Pi for DNS.
For the NextDNS dashboard to show device names (for example, "Samsung Galaxy", "MacBook Pro") instead
of IP addresses, the CLI needs to read from mDNS/ARP:
The installer creates a systemd service automatically. Verify:
If the Pi is offline, devices will fall back to the Secondary DNS set in your router (Quad9 in the
example above). This means filtering is temporarily disabled but internet access continues.
For higher availability, run NextDNS CLI on a second Pi and set it as the secondary DNS.
Force devices to renew their DHCP lease:
1.16 Select a NextDNS transport and setup method
Impact: HIGH (Selecting an incompatible transport or omitting the required profile association can leave DNS traffic unfiltered, unencrypted, or attributed to the wrong profile.)
Choose the connection method before configuring a device, router, or network so the profile is
Choose the connection method before configuring a device, router, or network so the profile is
associated correctly and the expected DNS protections apply.
Use the Setup tab in my.nextdns.io as the source of truth for a profile's endpoints, then
select the strongest transport supported by the target platform and network. NextDNS supports DoH,
DoT, DoQ, and DoH3; legacy UDP is a compatibility fallback rather than the default choice.[1] [2]
Prefer an encrypted transport that carries the profile identifier. Use legacy UDP over IPv4 only
when the platform cannot use an encrypted transport, IPv6, or the NextDNS CLI.
| Transport | Profile association | Network requirement | Use when |
| --- | --- | --- | --- |
| DoH | Profile identifier is in the URL path. | HTTPS over TCP port 443. | The platform supports a custom DoH URL or DNS port 853 is blocked. |
| DoT | Profile identifier is in the hostname. | TLS over TCP port 853. | The operating system exposes native Private DNS or DoT settings. |
| DoQ | Obtain the endpoint from the Setup tab. | QUIC over UDP port 8853. | The client explicitly supports DoQ and UDP/8853 is permitted. |
| DoH3 | Obtain the endpoint from the Setup tab. | HTTP/3 over UDP port 443. | The client supports HTTP/3 DNS and the network permits QUIC. |
| UDP over IPv6 | Profile identifier is encoded in the IPv6 address. | IPv6 connectivity. | Encrypted DNS and the CLI are unavailable but the platform supports IPv6. |
| UDP over IPv4 | Link the network's public IP to the profile. | Stable or automatically updated public IPv4 address. | No encrypted DNS, IPv6, or CLI option is available. |
The profile-association mechanisms and the Linked IP restriction for legacy UDP/IPv4 are documented
by NextDNS.[3] DoT and DoQ use dedicated ports, while DoH and DoH3 use HTTPS ports; evaluate
firewall policy before choosing a transport.[2]
Start with platform capability: Use a native encrypted transport when available; choose the
CLI for router-level control and LAN client reporting.
Treat the Setup tab as canonical: Copy a profile's endpoint from the dashboard instead of
reusing an endpoint from another profile or a generic online example.
Verify after each network change: Recheck
test.nextdns.ioafter changing DNS, switchingnetworks, or changing a router's WAN connection.
Respect network policy: Obtain approval before changing DNS on managed corporate, school, or
shared networks.
Keep fallback explicit: If a non-NextDNS resolver is configured for availability, document
that some DNS queries can bypass the profile when the fallback is used.
A legacy UDP/IPv4 setup depends on the current public address. A dynamic address can stop matching
its profile after a reconnect, while CGNAT and simultaneous multi-WAN paths can make the address
unsuitable for deterministic profile association.[1] [3]
Solution: Configure a DDNS update path when the setup supports it, or move the device or router
to DoH, DoT, DoQ, DoH3, IPv6, or the NextDNS CLI.
A browser's DoH setting protects DNS initiated by that browser, not queries from other applications
or devices on the same LAN.
Solution: Configure DNS at the operating-system or router layer when system-wide or
network-wide coverage is required. Keep browser DoH for restricted environments or browser-specific
use cases.
A transport can associate queries with the correct profile without providing a distinct device label.
Router-level client discovery requires an appropriate local resolver setup, such as the CLI with
client reporting enabled.[4]
Solution: First verify the profile identifier on test.nextdns.io; then use the platform's
supported device-naming or router-level client-reporting mechanism when per-device analytics is
needed.
Symptoms: The test page shows no configuration, another profile, or an unencrypted protocol
when an encrypted transport was expected.
- [1] NextDNS Help Center: Which setup type to use?
- [2] NextDNS Help Center: What is DNS over TLS, DNS over QUIC, and DNS over HTTPS?
- [3] NextDNS Help Center: What is Linked IP?
- [4] NextDNS CLI Wiki: Home
Correct: Configure native encrypted DNS when the platform supports it
# ✅ DNS-over-HTTPS custom resolver
https://dns.nextdns.io/abc123
# ✅ DNS-over-TLS provider hostname
abc123.dns.nextdns.ioUse DoH for software that accepts a resolver URL and DoT for software that accepts a provider
hostname. Configure the endpoint in the operating system, browser, router, or MDM profile that
owns DNS resolution for the intended traffic.
Correct: Use the CLI for a router or UNIX host that needs local network features
# ✅ Use a placeholder profile ID and let the CLI manage local DNS integration.
nextdns config set -profile=abc123 -report-client-info
nextdns activate
nextdns statusInstall the CLI only on a host that is intended to be a local resolver. For a router deployment,
ensure DHCP advertises that resolver to LAN clients and verify that client DNS does not bypass it.
Correct: Use Linked IP only for legacy UDP/IPv4
# ✅ Verification after any setup change
https://test.nextdns.ioConfirm that the test page reports Connected and the intended configuration identifier. Then
generate a DNS query and confirm that it appears in the expected profile's logs.
Incorrect:
# ❌ Do not assume a legacy IPv4 DNS server identifies a profile by itself.
# Link the network public IPv4 address in the Setup tab before relying on the profile.Incorrect:
# ❌ Do not use a DoH URL in a field that requires a DoT hostname.
https://dns.nextdns.io/abc123Incorrect:
# ❌ Do not expose real profile IDs, API keys, or account data in source control,
support tickets, or client-side application bundles.Avoid Linked IP for CGNAT, multi-WAN load balancing, or networks where the observed public IPv4
cannot be kept current. Prefer an encrypted transport or a local CLI deployment in these cases.
Solution:**
- Recopy the endpoint for the intended profile from its Setup tab.
- Check that the field expects the correct value type: DoH URL versus DoT hostname.
For legacy UDP/IPv4, refresh the Linked IP or verify its DDNS hostname resolves to the current
public address.
Disable or reconcile competing DNS settings from a VPN, security product, router, browser, or
MDM policy.
- Re-run the test from the target application or device, not only from an administrator's device.
Symptoms: DNS works on one network but fails on a corporate, public Wi-Fi, or restricted LAN.
Solution:**
Confirm that the selected transport's port is allowed: TCP/443 for DoH, TCP/853 for DoT,
UDP/8853 for DoQ, or UDP/443 for DoH3.[2]
- Use an approved alternative transport supported by the device and network policy.
Do not silently fall back to unencrypted DNS if the deployment requires encrypted DNS; escalate
the firewall or policy requirement to the network administrator.
1.17 Synology Integration (DSM and SRM)
Impact: MEDIUM (Proper installation of NextDNS on Synology devices (DSM NAS and SRM routers) enables network-wide DNS protection. Without this guidance, users may struggle with SSH access, especially the critical step of enabling the admin user on SRM for root access.)
Essential for deploying NextDNS on Synology NAS (DSM) and routers (SRM) with proper SSH access and
Essential for deploying NextDNS on Synology NAS (DSM) and routers (SRM) with proper SSH access and
network configuration
Synology provides two operating systems: DSM for NAS devices and SRM for routers. This rule
provides platform-specific guidance for installing the NextDNS CLI on both platforms.
| Platform | Full Name | Device Type | Use Case |
| -------- | ----------------------- | ----------- | --------------------------------- |
| DSM | DiskStation Manager | NAS | Network storage, local DNS server |
| SRM | Synology Router Manager | Router | Network gateway, DHCP server |
- Log in to DSM Web Interface
- Navigate to Control Panel
- Select Terminal and SNMP
- Check Enable SSH service
- Click Apply
SRM requires an additional critical step to enable root access via the admin user.
⚠️ This step is mandatory for SRM. Skipping it will prevent SSH access.
- Log in to SRM Web Interface
- Navigate to Control Panel
- Select User tab
- Locate the admin user in the list
- Click Edit
- Uncheck "Disable this account"
- Set a strong password for the admin user
- Click OK
- In Control Panel, navigate to Services
- Locate SSH section
- Check Enable SSH services
- Click Apply
Important: Connect using the root username (not admin) with the admin password you set.
After installing NextDNS on your Synology device, configure your network to use it as the DNS
server.
If you're using SRM as your router, configure DHCP to automatically assign the NextDNS-enabled
device as the DNS server:
- Navigate to Network Center → DHCP Server
Under DNS Server, set:
- Primary DNS: IP address of your Synology router (for example,
192.168.1.1)
- Primary DNS: IP address of your Synology router (for example,
- Click Apply
If you're using DSM as a local DNS server for your network:
- Access your router's DHCP settings (non-Synology router)
- Set the Primary DNS to your DSM device IP (for example,
192.168.1.10) - Apply the changes
Recommendation: Set a static IP address for your Synology device to prevent DNS resolution
issues if the IP changes.
- Navigate to Control Panel → Network → Network Interface
- Select your network interface and click Edit
- Under IPv4, select Use manual configuration
- Enter your desired static IP, subnet mask, and gateway
- Click OK
- Navigate to Network Center → Local Network → Network Interface
- Select your WAN or LAN interface
- Configure a static IP address
- Click Apply
After installation, verify that NextDNS is working:
Visit https://test.nextdns.io from a device on your network to confirm
NextDNS is active.
If the installation fails or you encounter issues, run the installer in debug mode:
This will output verbose information to help identify the problem.
Cause: The admin user is disabled (default state on SRM).
Solution: Follow Step 1 under "SRM Installation" to enable the admin user.
Cause: DHCP clients are not using the Synology device as their DNS server.
Solution:
- Check DHCP server configuration
- Verify the Synology device has a static IP
Renew DHCP leases on client devices (
ipconfig /release && ipconfig /renewon Windows, orreconnect Wi-Fi)
Cause: Port 53 may be in use by another service.
Solution:
1.18 Tailscale Integration
Impact: HIGH (Without proper Tailscale integration, users cannot protect their mesh VPN traffic with NextDNS filtering. This leaves devices vulnerable to threats when accessing resources through Tailscale tunnels and prevents centralized DNS policy enforcement across distributed networks.)
Critical for protecting mesh VPN traffic with NextDNS filtering and enforcing DNS policies across
Critical for protecting mesh VPN traffic with NextDNS filtering and enforcing DNS policies across
distributed networks
Tailscale is a zero-config mesh VPN built on WireGuard that makes it easy to connect devices
securely. By integrating NextDNS with Tailscale, you can ensure that all traffic flowing through
your Tailscale network benefits from NextDNS filtering and protection.
Tailscale integrates with NextDNS using DNS-over-HTTPS (DoH) as the transport protocol. This
ensures encrypted DNS queries across your entire mesh network, even when devices are on untrusted
networks.
This configuration applies NextDNS to all devices in your Tailscale network (tailnet).
- Log in to your NextDNS dashboard
- Navigate to the Setup tab
- Find the Endpoints section
- Copy the IPv6 address (format:
2a07:a8c0::xx:xxxx) - Open the Tailscale Admin Console
- Navigate to DNS settings
- Under Nameservers, select Custom
- Add your NextDNS IPv6 endpoint address
- Critical: Enable Override local DNS to force all devices to use NextDNS
This setting must be enabled to ensure NextDNS is actually used:
- Without this option, devices may continue using their local DNS settings
- Enabling it forces all DNS queries through Tailscale's resolver
- This is the most common cause of integration failures
Tailscale's Access Control List (ACL) system allows you to assign different NextDNS profiles to
specific devices or user groups using node attributes.
You can specify which NextDNS profile each device should use through ACL policies:
NextDNS cannot be used as a split DNS server alongside other DNS providers in Tailscale. You must
choose one of the following:
- Option A: Use NextDNS exclusively for all DNS queries
- Option B: Use another DNS provider and forgo NextDNS integration
There is no hybrid configuration where some domains use NextDNS and others use different resolvers.
The DoH integration requires IPv6 connectivity. Devices without IPv6 support may experience issues
or fallback to local DNS.
After configuration, verify the integration is working:
- Visit https://test.nextdns.io from a Tailscale-connected device
- Confirm it shows "This device is using NextDNS with
your profile" - Check the NextDNS logs to see queries from your Tailscale devices
- Test Before Full Deployment: Configure a single device first to verify functionality
- Use Tags Strategically: Organize devices with Tailscale tags for easier profile management
- Monitor Query Logs: Check NextDNS analytics to ensure queries are being routed correctly
- Document Profile Assignments: Keep a reference of which tags use which NextDNS profiles
Regular ACL Review: Audit your ACL configuration periodically to ensure correct profile
assignments
Forgetting to Enable Override: The most common mistake is not enabling "Override local DNS" in
Tailscale settings
- Wrong Endpoint Format: Ensure you use the IPv6 address from NextDNS Endpoints, not the DoH URL
- ACL Syntax Errors: JSON formatting errors in ACLs will prevent the configuration from saving
Profile ID Typos: Double-check NextDNS profile IDs in nodeAttrs to avoid routing to wrong
profiles
No Fallback DNS: If NextDNS is unavailable, DNS resolution may fail completely (consider
testing backup scenarios)
- Verify "Override local DNS" is enabled in Tailscale Admin Console
- Check that the NextDNS IPv6 endpoint is correctly entered
- Restart the Tailscale client on affected devices
- Test IPv6 connectivity:
ping6 2a07:a8c0::1 - Review your ACL nodeAttrs configuration for syntax errors
- Verify device tags are correctly assigned in Tailscale Admin Console
- Check that profile IDs match your NextDNS dashboard
- Use
tailscale statusto confirm device tags - Confirm devices are actually routing through Tailscale (check Tailscale status)
- Verify the profile ID in your configuration is correct
- Check if device metadata sharing is blocked by firewall rules
- Review Tailscale logs for DNS-related errors
Explanation:**
target: Specifies which devices/users this rule applies to (uses Tailscale tags or autogroups)attr: The NextDNS profile ID to apply (format:nextdns:YOUR_PROFILE_ID)- Replace
abc123,xyz789, and more with your actual NextDNS profile IDs
If you prefer not to share device information with NextDNS, use the no-device-info attribute:
This prevents Tailscale from sending device names, operating systems, and other metadata to NextDNS.
1.19 Ubiquiti (UniFi) Integration
Impact: HIGH (Without proper Ubiquiti integration guidance, users risk conflicts between NextDNS and UniFi's built-in filtering features, leading to DNS resolution failures and network outages. This rule prevents critical misconfigurations on UDM/UXG devices that could disrupt network-wide DNS services.)
Essential for preventing DNS conflicts on Ubiquiti UniFi Dream Machines and Gateways
Essential for preventing DNS conflicts on Ubiquiti UniFi Dream Machines and Gateways
Ubiquiti UniFi devices (UDM, UDM-Pro, UDM-SE, UXG-Pro, and UXG-Max families) are popular network
gateways that can integrate with NextDNS. However, improper configuration can cause conflicts with
UniFi's built-in DNS features, resulting in network-wide DNS failures.
Ubiquiti devices support two methods for NextDNS integration, depending on firmware version and use
case.
Availability: UniFi OS 3.0 and later
DNS Shield is a native feature that provides DNS-over-HTTPS without requiring command-line
configuration.
- Open the UniFi Network Application
- Navigate to Settings → Security → DNS Shield
- Toggle Enable DNS Shield
- Select Custom Provider
- Enter your NextDNS DoH URL:
https://dns.nextdns.io/YOUR_PROFILE_ID - Click Apply Changes
If installation fails, run the installer with debug output enabled:
This generates verbose logs that help identify the root cause of failures.
If you encounter APT repository errors (common on older UDM firmware), the Debian Stretch
repositories may be archived:
Prefer DNS Shield when available (UniFi OS 3.0+) for better compatibility and update
resilience
- Document Configuration: Keep notes on which method you're using and the profile ID
- Test After Updates: Verify NextDNS functionality after UniFi firmware updates
- Monitor Logs: Check NextDNS analytics regularly to ensure queries are being logged
- Backup Settings: Export UniFi configuration before making DNS changes
Use CLI for Advanced Needs: Only use CLI method if you need features not available in DNS
Shield
Not Disabling Conflicts: The most critical mistake is leaving Content Filtering or Ad Blocking
enabled with CLI installation
- Wrong Profile ID: Double-check your NextDNS profile ID during setup
- Hardcoded DNS on Devices: Some devices may have static DNS configured, bypassing the router
- Post-Update Testing: Always verify DNS after UniFi firmware updates
- SSH Access: Ensure SSH remains enabled if you need to troubleshoot CLI installations
| Feature | DNS Shield (Native) | NextDNS CLI |
| ---------------------- | ------------------- | ---------------------------- |
| UniFi OS Version | 3.0+ required | All versions |
| Installation | GUI-based | SSH/Command-line |
| Update Persistence | Automatic | May require reinstall |
| Advanced Routing | Limited | Full control |
| Complexity | Low | Medium-High |
| Conflicts | None | Must disable UniFi filtering |
Benefits:**
- No SSH access required
- Survives firmware updates automatically
- Managed through the UniFi web interface
- Simpler troubleshooting
Limitations:**
- Only available on UniFi OS 3.0+
- Limited advanced configuration options
Use Cases:**
- UniFi OS versions below 3.0
- Advanced routing configurations
- Conditional DNS forwarding
- Integration with custom scripts
- SSH access to the device
- Root privileges
- Internet connectivity from the device
- Open UniFi Network Application
- Navigate to Settings → System → Console Settings
- Enable SSH and note your password
Or use the device's IP address:
Execute the official installer script:
Follow the interactive prompts to complete installation.
The NextDNS CLI is incompatible with UniFi's built-in DNS filtering features. You must
disable both features to prevent DNS failures:
- Navigate to Settings → Network
- Locate Content Filtering
- Set to None
- Click Apply Changes
- Navigate to Settings → Application Firewall → General
- Locate Ad Blocking
- Uncheck Enable Ad Blocking
- Click Apply Changes
Warning: Failing to disable these features will cause DNS resolution conflicts, potentially
breaking network connectivity for all devices.
Queries originating from the UDM/UXG device itself (not network clients) will not be routed
through NextDNS. Only traffic from connected network devices will be filtered. This is a known
limitation of the CLI installation method.
Fix:**
Then retry the NextDNS installation.
Verify the NextDNS service is running:
Expected output: running
Verify your profile ID is correctly configured.
Possible Causes:**
- Content Filtering or Ad Blocking still enabled (check Settings again)
- Incorrect profile ID in configuration
- Network devices using hardcoded DNS servers (bypass router)
- VPN or proxy configurations overriding DNS settings
Verification Steps:**
- From a client device, visit: https://test.nextdns.io
- Confirm it detects your NextDNS profile
- Check the NextDNS logs for recent queries from your network
CLI Method Only: Firmware updates may remove the NextDNS CLI installation.
Solution:**
- Re-run the installer after firmware updates
- Consider switching to DNS Shield (Method 1) if available on your firmware version
2. Efficiency rules
Impact: HIGH
2.1 Backup and Failover Configuration
Impact: HIGH (Ensure continuous internet access even if NextDNS is unreachable)
A resilient network configuration ensures that DNS resolution continues even if the primary NextDNS
A resilient network configuration ensures that DNS resolution continues even if the primary NextDNS
connection is interrupted.
DNS is a single point of failure. If your router is configured only to use NextDNS and the service
or your connection to it fails, all internet access on your network will appear "down."
Most advanced routers (OpenWrt, pfSense, EdgeRouter) allow multiple DNS upstreams. Configure NextDNS
as the primary and a privacy-respecting public DNS as a secondary.
- ✅ Primary:
45.90.28.abc (NextDNS Anycast/Linked IP) - ✅ Secondary:
9.9.9.9 (Quad9)or1.1.1.1 (Cloudflare)
The NextDNS CLI supports multiple server definitions for the same domain or as a global failover.
Operating systems (Windows, macOS, iOS, Android) often attempt to query multiple DNS servers if the
first one times out. Adding a secondary DNS server in your DHCP settings provides this safety net.
⚠️ Caution: Adding a non-NextDNS secondary server (like 8.8.8.8) may lead to "DNS leaks" where
some queries bypass NextDNS filtering even when it is online. This happens because some OS
algorithms query all available servers and use the fastest response.
- For maximum privacy: Use only NextDNS across multiple bootstrap IPs or DoH endpoints.
For maximum availability: Use NextDNS as primary and Quad9 (which also blocks malware) as
secondary.
- NextDNS Help Center - Reliability
2.2 Pi-hole to NextDNS Migration
Impact: MEDIUM (Migrating without exporting custom blocklist entries causes loss of tailored domain rules accumulated over months or years of Pi-hole use)
Migrate from Pi-hole to NextDNS while preserving custom blocklist entries, local DNS records, and DHCP settings
Migrate from Pi-hole to NextDNS while preserving custom blocklist entries, local DNS records, and DHCP settings
Pi-hole users switching to NextDNS typically want to preserve:
- Custom blocked domains (ad-hoc additions to Pi-hole's blocklist)
- Custom allowed domains (allowlist entries for false positives)
- Local DNS records (hostname → IP mappings for home devices)
- DHCP settings (if Pi-hole was acting as the DHCP server)
NextDNS does not import Pi-hole databases directly, but its API makes it straightforward to
replicate these settings programmatically.
After verifying the import in the NextDNS dashboard:
Stop Pi-hole's DNS (but keep it running for DHCP if needed):
sudo systemctl stop pihole-FTL- Change your router's DHCP DNS to your NextDNS CLI installation or NextDNS's linked IP
- Force DHCP renewal on clients
- Monitor the NextDNS Logs tab for 24 hours — add any false positives to the allowlist
Pi-hole's DHCP server: NextDNS is DNS-only. If you used Pi-hole as a DHCP server, migrate
that function to your router or keep Pi-hole running for DHCP only.
Pi-hole's regex blocking: NextDNS denylist supports exact domains and wildcards
(
*.example.com) but not full regex patterns.Pi-hole's query logs stored locally: NextDNS logs are stored in the cloud (your chosen
region). If you need on-device log storage, this is a limitation.
- NextDNS API — Denylist
- NextDNS API — Rewrites
- Pi-hole Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

