| Crates.io | asn-fetcher |
| lib.rs | asn-fetcher |
| version | 0.3.0 |
| created_at | 2026-01-14 03:16:22.522972+00 |
| updated_at | 2026-01-20 03:22:19.570125+00 |
| description | A CLI tool to fetch ASN (Autonomous System Number) information from IP addresses |
| homepage | https://github.com/manugupt1/asn-fetcher-rs |
| repository | https://github.com/manugupt1/asn-fetcher-rs |
| max_upload_size | |
| id | 2042050 |
| size | 99,611 |
A CLI tool to fetch ASN (Autonomous System Number) information from IP addresses - built with Rust.
This tool queries an IP address and retrieves its associated Autonomous System Number (ASN), useful for network administration, security analysis, and understanding internet routing.
✅ Fully Functional - ASN lookup with RIPE NCC API, ipapi.co, and Team Cymru whois
Before you begin, ensure you have Rust installed (1.70 or later):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Clone the repository
git clone https://github.com/manugupt1/asn-fetcher-rs.git
cd asn-fetcher-rs
# Build the project
cargo build --release
# Using RIPE NCC API (default)
cargo run -- 8.8.8.8
# Using ipapi.co
cargo run -- 8.8.8.8 --source ipapi
# Using Team Cymru whois (requires whois command)
cargo run -- 8.8.8.8 --source cymru-whois
# IPv6 support
cargo run -- 2001:4860:4860::8888
# Run the optimized binary directly
./target/release/asn-fetcher 8.8.8.8
For ipapi.co with higher rate limits, set the IPAPI_API_KEY environment variable:
export IPAPI_API_KEY=your_api_key_here
cargo run -- 8.8.8.8 --source ipapi
# Run all tests
cargo test
# Run tests with output visible
cargo test -- --nocapture
# Format code
cargo fmt
# Run linter
cargo clippy
# Check formatting
cargo fmt -- --check
Use the release script to create a new version:
./scripts/release.sh patch # 0.1.0 -> 0.1.1
./scripts/release.sh minor # 0.1.0 -> 0.2.0
./scripts/release.sh major # 0.1.0 -> 1.0.0
The release process:
Contributions are welcome! To contribute:
git checkout -b feature/amazing-feature)cargo test && cargo clippy)cargo fmt)git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to the Rust community for excellent documentation and tools.
Happy Hacking! 🦀🌐