A command-line utility for retrieving ASN, owner, and associated CIDR prefixes (IPv4 and IPv6) for a given IP address, domain name, or ASN number. Powered by ipapi.is.
- Flexible Input: Supports IP addresses (IPv4 & IPv6), domain names, and ASN numbers (with or without
ASprefix). - Comprehensive Output: Returns ASN, owner information, and all associated CIDR prefixes.
- Filtering Options: Optionally filter results by address family (IPv4 or IPv6).
- JSON Support: Optionally output results in JSON format for easy machine processing.
Pre-compiled binaries for Windows, Linux, and macOS (supporting both amd64 and arm64 architectures) are available in the Releases section.
git clone https://github.com/aleksandrlomtev/asntool
cd asntool
go build -o asntool- Go 1.16 or higher (for building from source)
asntool <query> [flags]- Domain name:
asntool example.com - IP address:
asntool 8.8.8.8 - ASN number:
asntool 15169orasntool AS15169
-4: Return only IPv4 prefixes.-6: Return only IPv6 prefixes.-j,--json: Output result in JSON format.-a: Show only ASN and owner (no CIDRs).
asntool google.com
asntool 1.1.1.1 -4 # Get only IPv4 prefixes
asntool AS13335 -j # Get output in JSON formatMIT License. See LICENSE for details.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.