Wednesday, November 20, 2024

How to Use the ipinfo Tool

The ipinfo CLI tool allows you to look up IP address details, including bulk lookups, ASN, and geolocation information. Below is a guide to get started quickly:


Installation

  1. Install with Homebrew (macOS/Linux):

    brew install ipinfo-cli

  2. Install via Script: Download and install the tool using the provided script:
    curl -Ls https://github.com/ipinfo/cli/releases/latest/download/ipinfo.sh | sh

    Add the binary to your PATH:

    export PATH="$HOME/.ipinfo/bin:$PATH"

  3. Download Binary Manually (Linux/macOS/Windows):
    Download the appropriate binary from the GitHub releases page.

Basic Usage

Lookup a Single IP Address

To get detailed information about an IP address:

ipinfo <IP_ADDRESS>

Example:

ipinfo 8.8.8.8


Lookup Your Own IP

ipinfo myip


Bulk Lookup

Lookup multiple IP addresses from a file using a pipping

Note: make sure you have created your account on https://ipinfo.io  and you have your token which is required for bulk IP lookups

cat ips.txt| ipinfo -t YOUR_TOKEN

Or you can register your token using below command 

$  ipinfo init                  
1) Enter an existing API token
2) Sign up or log in at ipinfo.io with your browser

Press 1 and then paste your token which you have got while creating account on ipinfo.io

Advanced Features

Filter Fields

Use the -f flag to specify the fields you want in the output:

ipinfo 8.8.8.8 -f ip,country,city


For further details, refer to the official documentation.



No comments:

Post a Comment