whois-that
whois-that is a fast, asynchronous WHOIS client library for Rust using tokio. It provides comprehensive domain information lookups with support for international domains, custom server lists, and various character encodings.
Features
- Async by default - Built on Tokio for non-blocking network operations
- International Domain Support - Handles IDNs via IDNA Punycode conversion
- Multiple Character Encodings - Support for non-UTF8 responses (Windows-1252)
- Configurable Server Lists - Use default or custom WHOIS server configurations
- Efficient Domain Suffix Lookup - Fast TLD and domain lookups
- Minimal Dependencies - Feature flags let you include only what you need
- Easy Error Handling - Comprehensive error types with thiserror
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
= { = "1", = ["full"] }
Feature Flags
The library uses feature flags to provide flexibility:
| Flag | Description | Default |
|---|---|---|
serde |
Enable serde support for loading server lists from files/JSON data | ✓ |
idna |
Enable IDNA support for international domain names | ✓ |
decode-global |
Enable Windows-1252 character encoding support | ✓ |
To use only specific features:
[]
= { = "0.1.0", = false, = ["serde", "idna"] }
Usage
Basic Usage
use Whois;
use WhoisBuilder;
async
Custom Server List
You can provide your own WHOIS server list as a JSON file:
use Whois;
use WhoisBuilder;
use Path;
async
International Domain Names
When the idna feature is enabled (on by default), you can lookup international domain names:
use Whois;
use WhoisBuilder;
async
Server List Format
Custom server lists should be JSON files in the following formats:
{
// Standard format
"io": "whois.nic.io",
// Detailed format
"net": {
"host": "whois.verisign-grs.com",
"query": "DOMAIN $addr\r\n",
"punycode": true
},
}
Contributing
Contributions are welcome!