cIP | Country IP

cIP – Countries IP | Get IP country Information, Get IPs of countries by name, …


git clone && cd cip

Next step, if your system is Linux, runs:

go generate

with go generate, moves database to destination

  • destinations:
    • On Linux: /opt/cIP/database.csv
    • Other: needn’t to move

Otherwise, only run this to compile:

go build

How To Use

in command

First see usage:

$ ./cip in -h
Usage: ./cip in [options] [names...]

Description: IPs of countries

        -limit N         Result limit
        -offset N        Result offset
        -h, -help        Show this message

    ./cip in "IR" # will print IRAN IPs
    ./cip in "CHN" "US" # will print CHINA & USA IPs

Example of result:

From -          To              Registry        Assigned        Country -       apnic           1302739200      CHINA -       apnic           1302739200      CHINA -      apnic           1302566400      CHINA -      apnic           1302566400      CHINA -       apnic           1302739200      CHINA

info command

First see usage:

$ ./cip info -h
Usage: ./cip info [options] [ip...]

Description: Get IPs information like country

        -network            use ip network e.g. "" ""
        -h, -help           show this message

        ./cip info # will print ... ITALY
        ./cip info -network "" # will print .... ITALY

db command

This command copies database from source to current directory named ‘database.csv’.


View Github