Notifications

DNSControl includes built-in support for notifications, enabling you to post messages in team chats or send emails whenever DNS changes occur, with the functionality implemented in the notifications package.

Configuration

Notifications are set up in your credentials JSON file. They will use the notifications key to look for keys or configuration needed for various notification services.

creds.json
{
  "r53": {},
  "gcloud": {},
  "notifications": {
    "slack_url": "https://api.slack.com/apps/0XXX0X0XX0/incoming-webhooks",
    "teams_url": "https://outlook.office.com/webhook/00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000/IncomingWebhook/00000000000000000000000000000000/00000000-0000-0000-0000-000000000000",
    "shoutrrr_url": "discover://token@id"
  }
}

Usage

If you want to send a notification, add the --notify flag to the dnscontrol preview or dnscontrol push commands.

Below is an example where we add the A record foo and display the notification output.

dnsconfig.js
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
+ A("foo", "1.2.3.4"),
END);

Preview example

In case of dnscontrol preview:

The notification output

Push example

In case of dnscontrol push:

The notification output

Notification services

Shoutrrr

DNSControl supports various notification methods via Shoutrrr, including email (SMTP), Discord, Pushover, and many others. For detailed setup instructions, click on the desired service:

For a full overview of supported methods and configuration details, refer to the Shoutrrr documentation.

Configure shoutrrr_url with the Shoutrrr URL to be notified.

Slack/Mattermost

If you want to use the Slack integration, you need to create a webhook in Slack. Please see the Slack documentation or the Mattermost documentation

Configure slack_url to this webhook. Mattermost works as well, as they share the same api,

Microsoft Teams

If you want to use the Teams integration, you need to create a webhook in Teams. Please see the Teams documentation

Configure teams_url to this webhook.

Telegram

If you want to use the Telegram integration, you need to create a Telegram bot and obtain a Bot Token, as well as a Chat ID. Get a Bot Token by contacting @BotFather, and a Chat ID by contacting @myidbot.

Configure telegram_bot_token and telegram_chat_id to these values.

Bonfire

This is Stack Overflow's built in chat system. This is probably not useful for most people.

Configure bonfire_url to be the full url including room and api key.

Last updated