Domain Finder is a robust, production-ready Discord bot written in Go. It autonomously monitors domain names for critical changes (WHOIS data) and upcoming expirations, alerting you directly in your Discord server. It features a persistent SQLite database, interactive commands, and a secure systemd service installer.
- 🔍 Automated WHOIS Monitoring: Periodically checks your domains against a configurable schedule.
- 🚨 Smart Alerts:
- Change Detection: Instantly notifies you of changes to
Updated Date,Expiry Date,Registrant, orName Servers. - Expiration Warnings: alerts 48 hours before expiration.
- High-Frequency Mode: Automatically switches to 1-minute checks for domains expiring within 60 minutes.
- Change Detection: Instantly notifies you of changes to
- 💬 Interactive Discord Integration:
- Public Alerts: Post alerts to a specific channel.
- Acknowledge: React with ✅ to acknowledge and silence active alerts.
- Personal Reminders: Users can set private DM reminders for specific domains (
!remindme).
- 💾 Persistent Storage: All domain data, history, and user preferences are stored locally in a SQLite database (
domains.db). - 🛡️ Secure & Production-Ready: Includes a
systemdinstaller script that sets up a dedicated, non-privileged user and locks down file permissions.
- Go 1.19+ installed on your system.
- A Discord Bot Token (see below).
git clone https://github.com/aramova/domain_finder.git
cd domain_finderCreate a config.json file in the project root. You can use the example as a template:
cp config.example.json config.jsonEdit config.json to add your credentials:
{
"discord_bot_token": "YOUR_BOT_TOKEN_HERE",
"discord_channel_id": "YOUR_CHANNEL_ID_HERE",
"check_interval_minutes": 60
}How to get a Token:
- Go to the Discord Developer Portal.
- Create a New Application -> Bot -> Add Bot.
- Reset Token to get your secret token.
- Enable Message Content Intent and Server Members Intent.
- Use the OAuth2 URL Generator (scope:
bot, permissions:Send Messages,Read Message History,Add Reactions) to invite the bot to your server.
go build -o domain_finder
./domain_finderFor a permanent installation, use the provided installer script. This sets up the bot as a systemd service running under a restricted user.
-
Build the binary:
go build -o domain_finder
-
Run the Installer (as root):
sudo ./install_service.sh
- Creates a system user
domain_finder. - Installs binary to
/usr/local/bin/domain_finder. - Configs go to
/etc/domain_finder/. - Database goes to
/var/lib/domain_finder/. - Enables the
domain_findersystemd service.
- Creates a system user
-
Manage the Service:
sudo systemctl start domain_finder sudo systemctl status domain_finder sudo journalctl -u domain_finder -f
| Command | Description | Example |
|---|---|---|
!help |
Show this help message. | !help |
!lookup <domain> |
Perform an immediate WHOIS lookup. | !lookup google.com |
!add <domain> |
Add a domain to the monitoring list. | !add github.com |
!remove <domain> |
Stop monitoring a domain. | !remove github.com |
!list |
Show all currently monitored domains. | !list |
!stats <domain> [n] |
View historical WHOIS data (n=1 is latest). | !stats google.com 2 |
!remindme [domain] |
Set a personal DM reminder for a domain. | !remindme google.com |
!testremindme <domain> |
Test the DM reminder flow. | !testremindme google.com |
main.go: Entry point, config loading, and service orchestration.scheduler.go: The heartbeat. Manages the ticker and triggers domain checks.database.go: SQLite interactions (schema, CRUD operations).discord.go: Discord API wrapper and event handlers.whois.go: WHOIS parsing and comparison logic.
Contributions are welcome! Please check out the CONTRIBUTING.md (coming soon) or open an issue.