Get detailed information of an IP

  2 mins read  

Get detailed information of an IP

ipinfo is the official CLI tool for the IPinfo.io IP address API, allowing you to:

  • Look up IP details in bulk or one by one.
  • Look up the ASN details.
  • Summarize details for up to 1000 IPs at a time.
  • Open a map of IP locations for any set of IPs.
  • Filter the IPv4 and IPv6 addresses from any entry.
  • Print IP lists for any CIDR or IP range.
  • And more!

Installation

You will need to have the Go programming language installed on your system in addition to Git.

After that run the commands:

git clone https://github.com/ipinfo/cli ipinfo-cli
cd ipinfo-cli/
go build -o ~ ./ipinfo
cd
sudo install -v ipinfo .local/bin/

Then remove the cloned directory: ipinfo-cli.

Use

To get a help of the parameters, just run the ipinfo command, something like this will appear:

Usage: ipinfo <cmd> [<opts>] [<args>]

Commands:
  <ip>        look up details for an IP address, e.g. 8.8.8.8.
  <asn>       look up details for an ASN, e.g. AS123 or as123.
  myip        get details for your IP.
  bulk        get details for multiple IPs in bulk.
  summarize   get summarized data for a group of IPs.
...

To get data from your own IP, run:

ipinfo myip

Find out the IP of a given URL and get detailed information with ipinfo:

Example, get data from the URL: https://en.terminalroot.com.br/

ipinfo $(ping -c1 en.terminalroot.com.br | sed -n '1p' | sed 's/.* (//;s/) .*//')

Output in JSON format

ipinfo myip --json

The parameters must be indicated at the end of the command.

See an example GIF usage:

ipinfo

For more information access the links below:

Add our feed: https://en.terminalroot.com.br/feed to:

Feedly