Skip to content

Notifications

Get instant notifications when domains are blocked, unblocked, or when special modes are activated. NextDNS Blocker supports multiple notification channels with batching and async delivery.

ChannelDescription
DiscordWebhook notifications with rich embeds
TelegramBot notifications via Telegram API
SlackWebhook notifications with Block Kit
NtfySimple push notifications via ntfy.sh
macOSNative system notifications via osascript

Notifications are configured in config.json under the notifications section:

{
"notifications": {
"enabled": true,
"channels": {
"discord": {
"enabled": true,
"webhook_url": "https://discord.com/api/webhooks/1234567890/abcdefghijklmnop"
},
"telegram": {
"enabled": true,
"bot_token": "123456:ABC-DEF...",
"chat_id": "123456789"
},
"slack": {
"enabled": true,
"webhook_url": "https://hooks.slack.com/services/..."
},
"ntfy": {
"enabled": true,
"topic": "my-nextdns-alerts"
},
"macos": {
"enabled": true,
"sound": true
}
}
}
}
FieldTypeDefaultDescription
enabledbooleantrueMaster switch for all notifications
channelsobject{}Channel-specific configurations
{
"discord": {
"enabled": true,
"webhook_url": "https://discord.com/api/webhooks/..."
}
}
FieldTypeRequiredDescription
enabledbooleanYesEnable Discord notifications
webhook_urlstringYesFull Discord webhook URL

Creating a Discord Webhook:

  1. Open Discord server settings
  2. Go to Integrations > Webhooks
  3. Click New Webhook
  4. Name it (e.g., “NextDNS Blocker”)
  5. Select the channel for notifications
  6. Click Copy Webhook URL
{
"telegram": {
"enabled": true,
"bot_token": "123456:ABC-DEF...",
"chat_id": "123456789"
}
}
FieldTypeRequiredDescription
enabledbooleanYesEnable Telegram notifications
bot_tokenstringYesTelegram Bot API Token
chat_idstringYesTarget Chat ID (user or group)

Setup:

  1. Chat with @BotFather to create a bot and get bot_token
  2. Chat with @userinfobot to get your chat_id
{
"slack": {
"enabled": true,
"webhook_url": "https://hooks.slack.com/services/..."
}
}
FieldTypeRequiredDescription
enabledbooleanYesEnable Slack notifications
webhook_urlstringYesSlack Incoming Webhook URL

Setup:

  1. Create an Incoming Webhook in your Slack workspace
  2. Copy the Webhook URL
{
"ntfy": {
"enabled": true,
"topic": "my-nextdns-alerts",
"server": "https://ntfy.sh"
}
}
FieldTypeDefaultDescription
enabledbooleanNoEnable Ntfy notifications
topicstringRequiredTopic name to subscribe to
serverstringhttps://ntfy.shOptional self-hosted server URL
{
"macos": {
"enabled": true,
"sound": true
}
}
FieldTypeDefaultDescription
enabledbooleanNoEnable macOS native notifications
soundbooleantruePlay sound with notification

Note: macOS notifications only work when running on macOS. The channel is automatically disabled on other platforms.

After each sync, a summary notification is sent:

Discord Example:

:bar_chart: NextDNS Blocker Sync Complete
:red_circle: Blocked (3): reddit.com, twitter.com, instagram.com
:green_circle: Unblocked (1): github.com
:shield: PC Activated (2): gambling, tiktok
:clock3: Scheduled (1): bumble.com
Profile: abc123 | Synced at 14:30

macOS Example:

NextDNS Blocker Sync
Blocked: 3 | Unblocked: 1 | Allowed: 0
EventIconColorDescription
Block:red_circle:RedDomain added to denylist
Unblock:green_circle:GreenDomain removed from denylist
Allow:white_check_mark:GreenDomain added to allowlist
Disallow:x:OrangeDomain removed from allowlist
PC Activate:shield:BlueParental Control category/service activated
PC Deactivate:unlock:BlueParental Control category/service deactivated
Pending:clock3:YellowUnblock scheduled with delay
Panic:rotating_light:Dark RedPanic mode activated
Error:warning:RedOperation failed

Instead of sending individual notifications for each domain change, events are collected during a sync operation and sent as a single notification:

  • Reduces notification spam
  • Provides a summary view
  • Groups events by type

Notifications are sent asynchronously in a background thread:

  • Sync operations don’t wait for notification delivery
  • Notification failures don’t affect sync success
  • Multiple adapters can send in parallel

Discord webhooks have rate limits. NextDNS Blocker handles this by:

  • Batching events to reduce API calls
  • Logging rate limit errors without retrying

Verify your notification setup:

Terminal window
nextdns-blocker test-notifications

This sends a test message to all configured and enabled channels.

{
"version": "1.0",
"settings": {
"timezone": "America/New_York"
},
"notifications": {
"enabled": true,
"channels": {
"discord": {
"enabled": true,
"webhook_url": "https://discord.com/api/webhooks/123456789/abcdef..."
},
"macos": {
"enabled": true,
"sound": true
}
}
},
"blocklist": [...]
}
{
"notifications": {
"enabled": false
}
}
{
"notifications": {
"enabled": true,
"channels": {
"discord": {
"enabled": false,
"webhook_url": "..."
}
}
}
}

Simply remove the notifications section from config.json.

  1. Check webhook URL:

    • Verify URL starts with https://discord.com/api/webhooks/
    • Copy fresh from Discord settings
  2. Check configuration:

    Terminal window
    nextdns-blocker config show

    Look for the notifications section.

  3. Test webhook manually:

    Terminal window
    curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"content": "Test from NextDNS Blocker"}' \
    "YOUR_WEBHOOK_URL"
  4. Check logs:

    Terminal window
    tail -20 ~/.local/share/nextdns-blocker/logs/cron.log
  1. Check System Preferences:

    • Go to System Preferences > Notifications
    • Ensure notifications are allowed for Terminal/iTerm
  2. Check platform:

    • macOS notifications only work on macOS
    • The channel is auto-disabled on other platforms
  1. Recreate webhook in Discord
  2. Update config.json with new URL
  3. Test with nextdns-blocker test-notifications

Notifications include:

  • Domain names being blocked/unblocked
  • Category/service names (Parental Control)
  • Timestamps
  • Action types

Notifications don’t include:

  • Your IP address
  • NextDNS credentials
  • Full configuration details
  1. Use a private Discord server
  2. Don’t share webhook URLs
  3. Consider a dedicated notification channel
  4. Review channel access permissions

Create different webhooks for different purposes:

  1. #nextdns-alerts - All sync notifications
  2. #nextdns-panic - Only panic mode (urgent)
  3. #accountability - Share with accountability partner
  • Private channel: Personal monitoring
  • Shared channel: Accountability with trusted person