pending
The pending command group manages queued unblock actions that are waiting for their delay to expire.
Overview
Section titled “Overview”When you attempt to unblock a domain that has an unblock_delay configured, the unblock is queued as a pending action. This creates friction against impulsive decisions.
Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
list | List all pending actions |
show | Show details of a specific action |
cancel | Cancel a pending action |
pending list
Section titled “pending list”List all pending unblock actions.
nextdns-blocker pending list [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
--all | Include expired/executed actions |
Output
Section titled “Output”Pending Actions (2)
ID Domain Execute At Remaining─────────────────────────────────────────────────────────────────────────────pnd_20240115_143000_a1b2c3 bumble.com 2024-01-16 14:30:00 23h 45mpnd_20240115_150000_d4e5f6 twitter.com 2024-01-15 19:00:00 4h 30mWith —all Flag
Section titled “With —all Flag”nextdns-blocker pending list --allShows additional columns for status:
Pending Actions (4)
ID Domain Execute At Status─────────────────────────────────────────────────────────────────────────────pnd_20240115_143000_a1b2c3 bumble.com 2024-01-16 14:30:00 pendingpnd_20240115_150000_d4e5f6 twitter.com 2024-01-15 19:00:00 pendingpnd_20240115_100000_g7h8i9 reddit.com 2024-01-15 10:30:00 executedpnd_20240114_200000_j0k1l2 instagram.com 2024-01-15 08:00:00 cancelledNo Pending Actions
Section titled “No Pending Actions”No pending actions
Pending actions are created when you run: nextdns-blocker unblock <domain>
For domains with unblock_delay > "0"pending show
Section titled “pending show”Show detailed information about a specific pending action.
nextdns-blocker pending show ACTION_IDExample
Section titled “Example”nextdns-blocker pending show pnd_20240115_143000_a1b2c3Output
Section titled “Output”Pending Action Details━━━━━━━━━━━━━━━━━━━━━━
ID: pnd_20240115_143000_a1b2c3
Domain: bumble.comDescription: Dating app
Created: 2024-01-15 14:30:00Delay: 24hExecute at: 2024-01-16 14:30:00
Status: pendingRemaining: 23 hours, 45 minutes
To cancel: nextdns-blocker pending cancel pnd_20240115_143000_a1b2c3Action ID Format
Section titled “Action ID Format”Action IDs follow the pattern:
pnd_YYYYMMDD_HHMMSS_RANDOMpnd_- Prefix indicating pending actionYYYYMMDD- Date createdHHMMSS- Time createdRANDOM- 6-character random suffix
You can use a partial ID if it’s unique:
nextdns-blocker pending show a1b2c3pending cancel
Section titled “pending cancel”Cancel a pending unblock action.
nextdns-blocker pending cancel ACTION_ID [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompt |
Example
Section titled “Example”nextdns-blocker pending cancel pnd_20240115_143000_a1b2c3Output
Section titled “Output”Cancel pending unblock for 'bumble.com'?
Created: 2024-01-15 14:30:00Would execute: 2024-01-16 14:30:00Remaining: 23 hours, 45 minutes
Cancel? [y/N]: y✓ Pending action cancelledSkip Confirmation
Section titled “Skip Confirmation”nextdns-blocker pending cancel pnd_20240115_143000_a1b2c3 -yOutput:
✓ Cancelled pending unblock for 'bumble.com'Tab Completion
Section titled “Tab Completion”With shell completion enabled, action IDs auto-complete:
nextdns-blocker pending cancel pnd_<TAB># Shows available action IDsHow Pending Actions Work
Section titled “How Pending Actions Work”Creation
Section titled “Creation”- User runs
unblock <domain> - Domain has
unblock_delay> “0” - Pending action is created with execute time = now + delay
- Action is stored in
pending.json
Execution
Section titled “Execution”- Sync runs (every 2 minutes)
- Checks for pending actions with execute time ≤ now
- Executes the unblock (removes from NextDNS denylist)
- Marks action as executed
- Sends Discord notification (if enabled)
Cancellation
Section titled “Cancellation”- User runs
pending cancel <ID> - Action is marked as cancelled
- Will not execute even if time passes
- Old cancelled actions are cleaned up daily
Pending Actions During Panic Mode
Section titled “Pending Actions During Panic Mode”When panic mode is active:
- New pending actions: Cannot be created (
unblockis hidden) - Existing pending actions: Paused (not executed)
- Cancellation: Still possible (cleanup allowed)
After panic expires:
- Pending actions resume processing
- Actions past their execute time are processed immediately
Storage
Section titled “Storage”Pending actions are stored in:
- macOS/Linux:
~/.local/share/nextdns-blocker/pending.json - Windows:
%LOCALAPPDATA%\nextdns-blocker\pending.json
File Format
Section titled “File Format”{ "actions": [ { "id": "pnd_20240115_143000_a1b2c3", "domain": "bumble.com", "created_at": "2024-01-15T14:30:00", "execute_at": "2024-01-16T14:30:00", "delay": "24h", "status": "pending" } ]}File Locking
Section titled “File Locking”The file uses atomic writes with file locking to prevent corruption from concurrent access.
Cleanup
Section titled “Cleanup”Old pending actions are automatically cleaned up:
- Executed actions: Kept for 7 days
- Cancelled actions: Kept for 7 days
- Daily cleanup: Runs via watchdog
Manual cleanup:
# Force cleanup by triggering syncnextdns-blocker config pushTroubleshooting
Section titled “Troubleshooting”Action not executing
Section titled “Action not executing”-
Check watchdog is running:
Terminal window nextdns-blocker watchdog status -
Check action details:
Terminal window nextdns-blocker pending show <ID> -
Check for panic mode:
Terminal window nextdns-blocker panic status -
Force sync:
Terminal window nextdns-blocker config push --verbose
Cannot cancel action
Section titled “Cannot cancel action”- Action might already be executed
- Check with
pending show <ID>
Duplicate pending actions
Section titled “Duplicate pending actions”Each unblock request creates a new pending action. Cancel duplicates:
nextdns-blocker pending listnextdns-blocker pending cancel <older-ID> -yPending.json corrupted
Section titled “Pending.json corrupted”If the file is corrupted:
# Backup and recreatemv ~/.local/share/nextdns-blocker/pending.json ~/.local/share/nextdns-blocker/pending.json.bakecho '{"actions":[]}' > ~/.local/share/nextdns-blocker/pending.json