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
Note: This is the
dev-ip-lookupbranch with full IP address support. Seemainbranch for stable domain-only lookups.
Quick Start
As HTTP Service
# Domain lookup
# IP address lookup
# Health check
As Library
[]
= "0.1"
use WhoisClient;
use IpAddr;
async
📖 See LIBRARY_USAGE.md for comprehensive examples.
API Endpoints
Domain Lookups
| Endpoint | Description |
|---|---|
GET /whois?domain=example.com |
Query via parameter |
GET /whois/:domain |
Query via path |
GET /whois/debug/:domain |
Include parsing analysis |
IP Address Lookups
| Endpoint | Description |
|---|---|
GET /ip?ip=8.8.8.8 |
Query via parameter |
GET /ip/:ip |
Query via path (IPv4 or IPv6) |
System
| Endpoint | Description |
|---|---|
GET /health |
Service health check |
GET /metrics |
Prometheus metrics |
GET /docs |
OpenAPI/Swagger UI (with openapi feature) |
Response Formats
Domain Response
IP Response
Performance
| Metric | Value |
|---|---|
| Fresh domain lookup | 450-900ms |
| Fresh IP lookup | 250-500ms |
| Cached lookup | <5ms |
| Throughput | 800+ lookups/min |
| Cache capacity | 10K+ entries |
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).
Development Branches
| Branch | Description |
|---|---|
main |
Stable release - domain lookups only |
dev-ip-lookup |
This branch - adds IPv4/IPv6 address lookups |
Build
# Development
# Release (optimized)
# Library only (no HTTP server)
License
MIT