Skip to content

File Locations

NextDNS Blocker stores files in platform-appropriate locations following XDG and Windows conventions.

TypemacOS/LinuxWindows
Config~/.config/nextdns-blocker/%APPDATA%\nextdns-blocker\
Data~/.local/share/nextdns-blocker/%LOCALAPPDATA%\nextdns-blocker\
Logs~/.local/share/nextdns-blocker/logs/%LOCALAPPDATA%\nextdns-blocker\logs\
Cache~/.cache/nextdns-blocker/%LOCALAPPDATA%\nextdns-blocker\cache\
PlatformPath
macOS~/.config/nextdns-blocker/
Linux~/.config/nextdns-blocker/
WindowsC:\Users\<user>\AppData\Roaming\nextdns-blocker\
FilePurposePermissions
config.jsonDomain schedules, blocklist, allowlist0600
.envAPI credentials, environment settings0600
Terminal window
# macOS/Linux
echo ~/.config/nextdns-blocker/
# Windows PowerShell
echo $env:APPDATA\nextdns-blocker\
PlatformPath
macOS~/.local/share/nextdns-blocker/
Linux~/.local/share/nextdns-blocker/
WindowsC:\Users\<user>\AppData\Local\nextdns-blocker\
FilePurposeDescription
.panicPanic stateISO timestamp when panic expires
.pin_hashPIN protectionSalted hash of PIN (if enabled)
.pin_sessionPIN sessionSession expiration timestamp
.pin_attemptsPIN attemptsFailed attempt tracking for lockout
.cannot_disable_lockProtection lockPersistent cannot_disable state
pending.jsonPending actionsQueue of delayed unblocks
unlock_requests.jsonUnlock requestsPending unlock requests for protected items
logs/Log directoryApplication and audit logs
Terminal window
# macOS/Linux
echo ~/.local/share/nextdns-blocker/
# Windows PowerShell
echo $env:LOCALAPPDATA\nextdns-blocker\
PlatformPath
macOS~/.local/share/nextdns-blocker/logs/
Linux~/.local/share/nextdns-blocker/logs/
WindowsC:\Users\<user>\AppData\Local\nextdns-blocker\logs\
FilePurposeRotation
app.logApplication eventsDaily, 7 days
audit.logBlock/unblock actionsWeekly, 12 weeks
cron.logWatchdog sync outputDaily, 7 days
wd.logWatchdog self-checkDaily, 7 days
sync.logSync operation detailsDaily, 7 days
FilePath
Sync job~/Library/LaunchAgents/com.nextdns-blocker.sync.plist
Watchdog job~/Library/LaunchAgents/com.nextdns-blocker.watchdog.plist

Entries in user’s crontab:

Terminal window
crontab -l

Tasks visible in:

  • taskschd.msc GUI
  • schtasks /query command

Task names:

  • NextDNS-Blocker-Sync
  • NextDNS-Blocker-Watchdog
{
"version": "1.0",
"settings": {
"timezone": "America/New_York",
"editor": null
},
"blocklist": [...],
"allowlist": [...]
}
Terminal window
NEXTDNS_API_KEY=your_key
NEXTDNS_PROFILE_ID=your_id
API_TIMEOUT=10
{
"actions": [
{
"id": "pnd_20240115_143000_a1b2c3",
"domain": "example.com",
"created_at": "2024-01-15T14:30:00",
"execute_at": "2024-01-16T14:30:00",
"delay": "24h",
"status": "pending"
}
]
}

Plain text ISO 8601 timestamp:

2024-01-15T15:30:00

On Linux, NextDNS Blocker respects XDG environment variables:

VariableDefaultUsed For
XDG_CONFIG_HOME~/.configConfiguration
XDG_DATA_HOME~/.local/shareData and logs
XDG_CACHE_HOME~/.cacheCache

Example override:

Terminal window
export XDG_CONFIG_HOME=/custom/config
nextdns-blocker init # Uses /custom/config/nextdns-blocker/

Always backup:

  • config.json - Your schedules and settings
  • .env - Your credentials

May want to backup:

  • pending.json - Pending unblock actions
  • audit.log - History of actions
Terminal window
# macOS/Linux
tar -czf nextdns-backup.tar.gz \
~/.config/nextdns-blocker/ \
~/.local/share/nextdns-blocker/pending.json
# Windows PowerShell
Compress-Archive -Path "$env:APPDATA\nextdns-blocker", "$env:LOCALAPPDATA\nextdns-blocker\pending.json" -DestinationPath nextdns-backup.zip
FilePermissionsMeaning
.env0600Owner read/write only
config.json0600Owner read/write only
*.log0644Owner read/write, others read

Files are created with user-only ACL by default.

Terminal window
# macOS/Linux
rm -rf ~/.config/nextdns-blocker
rm -rf ~/.local/share/nextdns-blocker
rm -rf ~/.cache/nextdns-blocker
# Windows PowerShell
Remove-Item -Recurse "$env:APPDATA\nextdns-blocker"
Remove-Item -Recurse "$env:LOCALAPPDATA\nextdns-blocker"
Terminal window
# macOS/Linux
rm ~/.local/share/nextdns-blocker/.panic
echo '{"actions":[]}' > ~/.local/share/nextdns-blocker/pending.json