ipinfo

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 15 Imported by: 0

README

ipinfo

Build Status Coverage Status GoDevDoc Time Tracker Code lines Comments

Install

go install github.com/vearutop/ipinfo@latest
$(go env GOPATH)/bin/ipinfo --help

Or download binary from releases.

Linux AMD64
wget https://github.com/vearutop/ipinfo/releases/latest/download/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz
./ipinfo -version
Macos Intel
wget https://github.com/vearutop/ipinfo/releases/latest/download/darwin_amd64.tar.gz && tar xf darwin_amd64.tar.gz && rm darwin_amd64.tar.gz
codesign -s - ./ipinfo
./ipinfo -version
Macos Apple Silicon (M1, etc...)
wget https://github.com/vearutop/ipinfo/releases/latest/download/darwin_arm64.tar.gz && tar xf darwin_arm64.tar.gz && rm darwin_arm64.tar.gz
codesign -s - ./ipinfo
./ipinfo -version

Usage

Usage: ipinfo [-mmdb <mmdb>] [-disp-cloud-dir <dir>] [-output <file>] [...ip|host]
  -disp-cloud-dir string
        path to github.com/disposable/cloud-ip-ranges directory
  -mmdb string
        input MMDB (MaxMind GeoIP) file
  -mmdb-type string
        mmdb type: city, country, asn, anon, conn
  -netrie value
        path to netrie index file, multiple DBs can be provided with multiple flags
        by default found in IPINFO_DEFAULT_DB env var glob
        or downloaded from https://github.com/vearutop/ipinfo/releases/tag/index
  -output string
        output file for netrie built from mmdb/cloud index
  -refresh
        refresh local netrie index from github

You can query IP addresses.

ipinfo 43.173.173.55 45.89.66.149
2025/12/29 18:39:25 downloading https://github.com/vearutop/ipinfo/releases/download/index/cloud.bin.zst
2025/12/29 18:39:26 downloading https://github.com/vearutop/ipinfo/releases/download/index/asn-lite.bin.zst
2025/12/29 18:39:27 downloading https://github.com/vearutop/ipinfo/releases/download/index/city-lite.bin.zst
43.173.173.55
cloud: 
asn-lite: AS132203 Tencent Building, Kejizhongyi Avenue
city-lite: SG:Singapore

45.89.66.149
cloud: 
asn-lite: AS209641 I-servers Ltd
city-lite: RU:Moscow

Or hosts, or both.

ipinfo reddit.com
151.101.129.140
cloud: fastly
asn-lite: AS54113 FASTLY
city-lite: US:Unknown

151.101.65.140
cloud: fastly
asn-lite: AS54113 FASTLY
city-lite: US:Unknown
...

If you have GeoIP2 bases, you can index them

ipinfo -mmdb GeoIP2-Connection-Type.mmdb -mmdb-type conn -output conn.bin
ipinfo -mmdb GeoIP2-Anonymous-IP.mmdb -mmdb-type anon -output anon.bin
ipinfo -mmdb GeoIP2-Country.mmdb -mmdb-type country -output country.bin
ipinfo -mmdb GeoIP2-ISP.mmdb -mmdb-type asn -output asn.bin
ipinfo -mmdb GeoIP2-City.mmdb -mmdb-type city -output cities.bin

and use by default with env var:

export IPINFO_DEFAULT_DB=/path/to/*.bin
ipinfo 43.173.173.55 45.89.66.149
43.173.173.55
GeoIP2 Anonymous IP: is_anonymous;is_hosting_provider
GeoIP2 ISP: AS132203 Tencent Building, Kejizhongyi Avenue
GeoIP2 City: SG:Singapore
GeoIP2 Connection Type: Corporate

45.89.66.149
GeoIP2 Anonymous IP: is_anonymous;is_hosting_provider
GeoIP2 ISP: AS209641 I-servers Ltd
GeoIP2 City: RU:Moscow
GeoIP2 Connection Type: Corporate

Documentation

Overview

Package main is an example CLI app.

Directories

Path Synopsis
Package cloud makes an index of cloud providers.
Package cloud makes an index of cloud providers.
Package tor makes an index of tor exit nodes.
Package tor makes an index of tor exit nodes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL