| Crates.io | ip2asn-cli |
| lib.rs | ip2asn-cli |
| version | 0.1.2 |
| created_at | 2025-08-03 08:39:22.281609+00 |
| updated_at | 2025-08-03 12:33:44.653168+00 |
| description | CLI for the ip2asn crate. |
| homepage | https://github.com/x123/ip2asn |
| repository | https://github.com/x123/ip2asn |
| max_upload_size | |
| id | 1779472 |
| size | 113,273 |
A high-performance, command-line tool for quickly looking up IP address to Autonomous System (AS) information.
The primary use is to look up an IP address directly.
# Look up a single IP
$ ip2asn 8.8.8.8
15169 | 8.8.8.8 | 8.8.8.0/24 | GOOGLE | US
You can look up multiple IPs or pipe them from standard input.
# Look up multiple IPs from arguments
$ ip2asn 1.1.1.1 9.9.9.9
13335 | 1.1.1.1 | 1.1.1.0/24 | CLOUDFLARENET | US
19281 | 9.9.9.9 | 9.9.9.0/24 | QUAD9-AS-CH | CH
# Read IPs from stdin
$ echo "208.67.222.222" | ip2asn
22822 | 208.67.222.222 | 208.67.222.0/24 | OPENDNS | US
For scripting, JSON output is available.
$ ip2asn --json 1.1.1.1
{"ip":"1.1.1.1","found":true,"info":{"network":"1.1.1.0/24","asn":13335,"country_code":"US","organization":"CLOUDFLARENET"}}
Install using cargo:
cargo install ip2asn-cli
You can control the tool's behavior by creating a configuration file at ~/.config/ip2asn/config.toml.
config.toml
# Set to false to disable the automatic 24-hour update check.
# The `update` subcommand will still work.
# Defaults to false.
auto_update = true
ip2asn-cli handles the IP-to-ASN dataset for you.
~/.cache/ip2asn/data.tsv.gz.update command.
$ ip2asn update
This project is licensed under the MIT License.