https://github.com/thinkphp/whois-lookup-tool
A CLI tool in Rust for performing WHOIS and DNS lookups
https://github.com/thinkphp/whois-lookup-tool
rust tokyo whois-lookup
Last synced: about 2 months ago
JSON representation
A CLI tool in Rust for performing WHOIS and DNS lookups
- Host: GitHub
- URL: https://github.com/thinkphp/whois-lookup-tool
- Owner: thinkphp
- License: other
- Created: 2025-01-30T02:19:02.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-01-30T12:27:30.000Z (9 months ago)
- Last Synced: 2025-03-27T21:48:09.120Z (7 months ago)
- Topics: rust, tokyo, whois-lookup
- Language: Rust
- Homepage: https://crates.io/crates/whois-dns-tool
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WHOIS and DNS Lookup Tool
A command-line interface (CLI) tool written in Rust for performing WHOIS and DNS lookups. This tool provides a simple way to query domain registration information and DNS records.
## Features
- WHOIS lookup for domains and IP addresses
- DNS record lookups (A, AAAA, MX, TXT, NS, CNAME)
- Automatic fallback to IANA WHOIS server
- Support for multiple TLD-specific WHOIS servers
- Colored output for better readability## Installation
Ensure you have Rust and Cargo installed on your system. Then clone this repository and build the project:
```bash
git clone git@github.com:thinkphp/whois-lookup-tool.git
cd whois-dns-tool
cargo build --release
```The compiled binary will be available in `target/release/whois-dns`.
## Usage
### WHOIS Lookup
To perform a WHOIS lookup for a domain or IP address:
```bash
whois-dns whois example.com
```### DNS Lookup
To perform a DNS lookup:
```bash
whois-dns dns example.com A # Look up A records
whois-dns dns example.com MX # Look up MX records
whois-dns dns example.com TXT # Look up TXT records
```Supported DNS record types:
- A (IPv4 addresses)
- AAAA (IPv6 addresses)
- MX (Mail exchange servers)
- TXT (Text records)
- NS (Nameservers)
- CNAME (Canonical names)## Dependencies
- `clap`: Command line argument parsing
- `colored`: Terminal text coloring
- `trust-dns-resolver`: DNS resolution
- `anyhow`: Error handling
- `tokio`: Async runtime## Error Handling
The tool implements robust error handling:
- Timeout handling for WHOIS queries
- Fallback to IANA WHOIS server when TLD-specific servers fail
- Informative error messages for DNS lookup failures
- Validation of DNS record types## Supported WHOIS Servers
The tool includes built-in support for various TLD WHOIS servers:
- .com and .net (VeriSign)
- .org (Public Interest Registry)
- .edu (EDUCAUSE)
- .it (NIC.it)
- .uk (Nominet)
- .ru (TCINET)
- .de (DENIC)
- .nl (SIDN)## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
MIT