Skip to content

Your First Sync

With your configuration in place, it’s time to run your first sync and see NextDNS Blocker in action.

The config push command:

  1. Reads your config.json blocklist
  2. Evaluates each domain against the current time and its schedule
  3. Adds/removes domains from your NextDNS denylist accordingly
  4. Processes any pending unblock actions

Before making actual changes, preview what would happen:

Terminal window
nextdns-blocker config push --dry-run

Output example:

DRY RUN - No changes will be made
Evaluating domains at 2024-01-15 14:30:00 (America/New_York)...
reddit.com
Schedule: Mon-Fri 12:00-13:00, 18:00-22:00
Current: Outside available hours
Action: Would BLOCK
twitter.com
Schedule: Always available on weekends
Current: Within available hours
Action: Would UNBLOCK
Summary: 1 would block, 1 would unblock

When you’re ready to apply changes:

Terminal window
nextdns-blocker config push

Output:

Syncing domains...
reddit.com: BLOCKED
twitter.com: UNBLOCKED
Sync complete: 1 blocked, 1 unblocked

For more detailed output:

Terminal window
nextdns-blocker config push --verbose

Or use the shorthand:

Terminal window
nextdns-blocker config push -v

This shows:

  • Current timezone and time
  • Each domain’s schedule evaluation
  • API calls made
  • Cache hits/misses

After syncing, verify the current state:

Terminal window
nextdns-blocker status

Output:

NextDNS Blocker Status
━━━━━━━━━━━━━━━━━━━━━━
Time: 2024-01-15 14:30:00 America/New_York
Blocklist (2 domains):
✗ reddit.com BLOCKED (until 18:00)
✓ twitter.com AVAILABLE (until 22:00)
Allowlist (1 domain):
✓ aws.amazon.com ALLOWED (always)
System:
Watchdog: Active
Panic Mode: Inactive
Pending Actions: 0
ConditionActionResult
Outside scheduleBlockAdded to NextDNS denylist
Within scheduleUnblockRemoved from denylist
No schedule (null)Always blockPermanent denylist entry
ConditionActionResult
No scheduleAlways allowPermanent allowlist entry
Within scheduleAllowAdded to NextDNS allowlist
Outside scheduleRemoveRemoved from allowlist

Manual syncing works, but the watchdog automates this:

Terminal window
# Install watchdog (runs config push every 2 minutes)
nextdns-blocker watchdog install
# Check watchdog status
nextdns-blocker watchdog status
# View watchdog logs
tail -f ~/.local/share/nextdns-blocker/logs/cron.log

The watchdog:

  • Runs config push every 2 minutes
  • Restores itself if removed
  • Logs all activity
  • Can be temporarily disabled

Your blocklist is empty. Add domains:

Terminal window
nextdns-blocker config edit

Your credentials are invalid. Re-run setup:

Terminal window
nextdns-blocker init

The domain was manually added to NextDNS. NextDNS Blocker will manage it going forward, but you can verify in the NextDNS dashboard.

Too many API calls. Wait a minute and try again. The tool has built-in rate limiting, but rapid manual syncs can exceed limits.