Skip to content

A production-grade DNS leak detection tool built with Rust, providing comprehensive DNS leak testing capabilities with a RESTful API.

License

Notifications You must be signed in to change notification settings

vpn9labs/vpn9-dns-leak-tool

Repository files navigation

VPN9 DNS Leak Test Tool

A production-grade DNS leak detection tool built with Rust, providing comprehensive DNS leak testing capabilities with a RESTful API.

Features

  • Dynamic Domain Generation: Automatically generates unique test domains for each leak test
  • Authoritative DNS Server: Built-in DNS server for true leak detection
  • Comprehensive DNS Leak Detection: Tests multiple DNS resolvers to identify potential leaks
  • Multi-resolver Testing: Supports testing against public DNS servers and custom resolvers
  • IPv4/IPv6 Support: Dual-stack testing capabilities
  • Real-time Analysis: Instant leak detection with severity assessment
  • RESTful API: Easy integration with existing systems
  • Prometheus Metrics: Built-in monitoring and observability
  • Rate Limiting: Protection against abuse
  • Production Ready: Docker support, health checks, graceful shutdown

Quick Start

Using Cargo

# Build and run
cargo build --release
cargo run --release

# With custom configuration
cargo run --release -- --config /path/to/config.toml --port 8080

Using Docker

# Build and run with Docker
docker build -t vpn9-dns-leak-tool .
docker run -p 8080:8080 -p 9090:9090 vpn9-dns-leak-tool

# Using Docker Compose
docker-compose up -d

API Usage

Create DNS Leak Test

# Dynamic domain generation test
curl -X POST http://localhost:8080/api/v1/test \
  -H "Content-Type: application/json" \
  -d '{
    "timeout_seconds": 30,
    "enable_ipv6": true,
    "custom_resolvers": ["8.8.8.8", "1.1.1.1"]
  }'

Get Test Results

curl http://localhost:8080/api/v1/test/{test_id}

Health Check

curl http://localhost:8080/api/v1/health

Metrics

curl http://localhost:9090/metrics

Configuration

The tool can be configured via:

  • Configuration file (config.toml)
  • Environment variables (prefix: DNS_LEAK_)
  • Command-line arguments

See config.toml for all available options.

Testing

# Run unit tests
cargo test

# Run integration tests
cargo test --test integration_test

# Run benchmarks
cargo bench

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3).

See the LICENSE file for the full text.

About

A production-grade DNS leak detection tool built with Rust, providing comprehensive DNS leak testing capabilities with a RESTful API.

Topics

Resources

License

Stars

Watchers

Forks