A Rust-based DNS monitoring tool that watches for changes in Cloudflare DNS records and sends notifications through Discord webhooks.
- 🔍 Monitors DNS records across multiple Cloudflare zones
- 🔄 Real-time detection of DNS record changes
- 📊 Tracks additions, modifications, and deletions of DNS records
- 💾 SQLite-based persistent storage for tracking changes
- 🚨 Discord notifications with detailed alerts
- 🔐 Secure API authentication using Cloudflare tokens
- Rust and Cargo installed
- Cloudflare API token with DNS permissions
- Discord webhook URL
- SQLite
- Clone the repository
- Build the project:
cargo build --release
Create a config.toml file in the project root with the following structure:
api_endpoint = "https://api.
cloudflare.com/client/v4"
api_token =
"your-cloudflare-api-token"
discord_webhook_url =
"your-discord-webhook-url"
Run the application:
cargo run --release
The application will:
- Load all existing DNS records from your Cloudflare zones
- Start monitoring for changes
- Send Discord notifications when:
- New DNS records are added
- Existing records are modified
- Records are deleted
The tool sends detailed Discord notifications with:
- Record type (A/CNAME)
- Domain name
- Content changes
- Severity level
- Timestamp of change
- src/main.rs : Application entry point and monitoring logic
- src/dns.rs : Cloudflare DNS API interaction
- src/db.rs : SQLite database operations
- src/discord.rs : Discord webhook notifications
- src/get_domains.rs : Cloudflare zone management
- tokio : Async runtime
- reqwest : HTTP client
- rusqlite : SQLite database
- serde : Serialization/deserialization
- config : Configuration management
- chrono : Time handling
- Store your config.toml securely
- Use restricted Cloudflare API tokens
- Monitor Discord webhook access
Contributions are welcome! Please feel free to submit a Pull Request.