ip2asn-cli-0.1.2 is not a library.
ip2asn-cli
A high-performance, command-line tool for quickly looking up IP address to Autonomous System (AS) information.
Quick Start
Basic Lookup
The primary use is to look up an IP address directly.
# Look up a single IP
| | | |
Advanced Usage
You can look up multiple IPs or pipe them from standard input.
# Look up multiple IPs from arguments
| | | |
| | | |
# Read IPs from stdin
|
| | | |
For scripting, JSON output is available.
}}
Installation
Install using cargo:
Configuration
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.
= true
Dataset Management
ip2asn-cli handles the IP-to-ASN dataset for you.
- Automatic Download: On the first run, the tool downloads the latest dataset from iptoasn.com.
- Caching: The dataset is cached at
~/.cache/ip2asn/data.tsv.gz. - Auto-Updates: If the cached data is over 24 hours old, the tool checks for a newer version and downloads it. This can be disabled in the configuration.
- Manual Updates: You can force an update at any time with the
updatecommand.
License
This project is licensed under the MIT License.