Whois Service
A high-performance WHOIS/RDAP lookup service built in Rust for internal automation and library integration. Designed for cybersecurity pipelines, alert enrichment, and threat intelligence workflows.
Overview
- RDAP-first with automatic WHOIS fallback for universal coverage
- 1,194 TLD mappings auto-generated from IANA bootstrap data at build time
- Domain and IP address lookups (IPv4 and IPv6)
- Intelligent caching with configurable TTL (avoids rate limiting)
- Calculated fields for threat detection:
created_ago,updated_ago,expires_in - Dual-use: Import as a Rust library or run as an HTTP API
Quick Start
As HTTP Service
# Domain lookup
# IP address lookup (IPv4)
# IP address lookup (IPv6)
# Health check
As Library
[]
= "0.2.1"
use WhoisClient;
async
📖 See LIBRARY_USAGE.md for comprehensive examples.
API Endpoints
All endpoints support both domains and IP addresses (auto-detection).
WHOIS/IP Lookups
| Endpoint | Description |
|---|---|
GET /whois?domain={query} |
Query via parameter (domain or IP) |
GET /whois/{query} |
Query via path (domain or IP) |
GET /whois/debug/{query} |
Include parsing analysis |
Examples:
# Domain lookups
# IP lookups (same endpoints)
System
| Endpoint | Description |
|---|---|
GET /health |
Service health check |
GET /metrics |
Prometheus metrics |
GET /docs |
OpenAPI/Swagger UI (with openapi feature) |
Response Format
Unified response structure for both domains and IP addresses:
Note: The domain field contains either a domain name OR an IP address. For IP lookups, the parsed_data.registrar field often contains the network name or organization.
Performance
| Metric | Value |
|---|---|
| Fresh lookup (domain or IP) | 250-900ms |
| Cached lookup | <5ms |
| Throughput | 800+ lookups/min |
| Cache capacity | 10K+ entries |
| Auto-detection overhead | <1μs |
Configuration
Key environment variables:
PORT=3000 # HTTP port
CACHE_TTL_SECONDS=3600 # Cache TTL (1 hour default)
CACHE_MAX_ENTRIES=10000 # Max cached domains
WHOIS_TIMEOUT_SECONDS=30 # Query timeout
CONCURRENT_WHOIS_QUERIES=8 # Parallel query limit
RUST_LOG=whois_service=info # Log level
The service auto-adapts to available system resources (memory, CPU cores).
Build
# Development
# Release (optimized)
# Library only (no HTTP server)
License
MIT