A Slack bot that uses OpenAI's beta Assistant functionality to provide feedback on DNS zone files and answer DNS-related questions. It integrates directly with UltraDNS's API to download zone files and health checks from your account, offering actionable suggestions and insights.
There's an example .env file in example.env.
To set up Slack integration, follow these steps:
- Go to Slack API Apps and create a new app.
- Obtain the necessary tokens:
- OAuth & Permissions
- Add the following bot scopes:
app_mentions:read,channels:history,channels:join,channels:read,chat:write,commandsandreactions:write - Install the bot to your workspace and copy the OAuth token. Use this for the
SLACK_BOT_TOKENvalue in the.envfile
- Add the following bot scopes:
- Event Subscriptions
- Subscripe to bot events
- Add the events
app_mentionandmessage.channels
- Socket Mode
- Enable socket mode
- Copy the app-level token and use this for the
SLACK_APP_TOKENvalue
- Slash Commands
- Create the following slash commands:
/udns-system-status/analyze-zone-file/zone-health-check
- The command descriptions and hints can be customized to suit your needs.
- Create the following slash commands:
- OAuth & Permissions
- Go to OpenAI API Keys
- Create an API key and use it as the
OPENAI_KEYvalue in the.envfile
Use the same credentials you use to log in to the UltraDNS web portal for the ULTRADNS_USERNAME and ULTRADNS_PASSWORD values in the .env file.
-
Install Docker
-
Build and run the bot container with:
docker compose up --build -d
- The
composecommand specifies the use of thedocker-compose.ymlmanifest - The
--buildflag builds the container using theDockerfile - The
-dflag runs the container as a daemon (in the background)
- The
To view Docker logs, use:
docker compose logs -fThe -f flag puts the logs in "follow" mode, updating them in real time.
Invite your bot to a channel.
Mention (@) the bot in a channel and ask a DNS-related question. The bot will respond only to DNS-specific questions and will ignore unrelated queries.
The bot currently supports three slash commands: /udns-system-status, /analyze-zone-file and /zone-health-check
Use the /udns-system-status command to check for any current outages, events or upcoming maintenance.
Use the /analyze-zone-file [comma-separated list of zones] command to export the BIND file(s) from your UltraDNS account. The bot will provide configuration feedback based on the exported files.
Use the /zone-health-check [comma-separated list of zones] command to leverage UltraDNS's health check API. The bot will analyze the zone's current status and provide a detailed summary.




