Skip to content

akashchouhan16/traceip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 TraceIP

A Command line tool built with Go to perform geolocation lookups on IP addresses, list MX records, Name Servers (NS) and track the Canonical names for host servers.

Retrieve information such as host, country, region, city, latitude, longitude and associated organisation with an IP address.

$ traceip

πŸ“œ Quick Setup

Learn more about go workspace and installation here.

  • Clone the GitHub repo:
    • $ git clone https://github.com/akashchouhan16/traceip.git
    • $ cd traceip
  • Install and compile traceip binary:
    • $ go install && go build
  • Run traceip:
    • $ traceip
      
  • System Prerequisites: Go 1.17 or above installed.

πŸ‹ Run with Docker

  • Pull the base image for traceip from docker hub.
    • $ docker pull akashchouhan16/traceip
  • Run as docker container.
    • $ docker run akashchouhan16/traceip
  • System Prerequisite: Docker runtime installed locally.

    Note: Incase any issue is faced with the setup, make sure the GOPATH is set to pwd and go version is updated. Refer the Go compilation guide.


🧬 Preview: go build & run the traceip binary

$ go build && traceip

   
 ======================================================
| β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  |
| β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— |
|    β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• |
|    β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•  |
|    β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘      |
|    β•šβ•β•   β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•šβ•β•      |
 ====================================================== 
A command line tool for networking utility and geolocation lookups on IP addresses.


Usage:
  traceip [command]

Available Commands:
  cname       Perform look up for canonical name (cname) for a particular host.
  completion  Generate the autocompletion script for the specified shell.
  help        Help about any command.
  mx          Perform MX Records look up for a particular host.
  ns          Perform look up for Name Servers for a particular host.
  trace       Geo locate an IPv4 or IPv6 with the trace command.

  Flags:
    -h, --help   help for traceip
    -4, --ipv4   Enforce IPv4 geo tracing only {wip}
    -6, --ipv6   Enforce IPv6 geo tracing only {wip}

  Use "traceip [command] --help" for more information about a command.

🧬 CMD: trace ip_address

To perform geo location lookup on the IP address

$ traceip trace 45.32.39.145

  Locating IP...

  =====================================================================
  +---+--------------+-----------------------------------+
  | - | PARAMETERS   | VALUE                             |
  +---+--------------+-----------------------------------+
  | 1 | IP Address   | 45.32.39.145                      |
  | 2 | City         | Ōi                                |
  | 3 | Region       | Saitama                           |
  | 4 | Country      | JP                                |
  | 5 | Coordinates  | 35.6090,139.7302                  |
  | 6 | Timezone     | Asia/Tokyo                        |
  | 7 | Zip/Postal   | 140-8508                          |
  | 8 | Organization | AS20473 The Constant Company, LLC |
  +---+--------------+-----------------------------------+
  =====================================================================

🧬 CMD: mx host_name

To list MX Records for a host

$ traceip mx cal.com

  =====================================================================
  MS Records for cal.com
  +---+--------------------------+----------------+
  | - | MX RECORD HOST           | MX RECORD PREF |
  +---+--------------------------+----------------+
  | 1 | aspmx.l.google.com.      |              1 |
  | 2 | alt1.aspmx.l.google.com. |              5 |
  | 3 | alt2.aspmx.l.google.com. |              5 |
  | 4 | alt4.aspmx.l.google.com. |             10 |
  | 5 | alt3.aspmx.l.google.com. |             10 |
  +---+--------------------------+----------------+
  =====================================================================

🧬 CMD: ns host_name

To list the Name Servers for a host

$ traceip ns cal.com

  =====================================================================
  Name Server(s) for cal.com
  +---+---------------------------+
  | - | NAME SERVER               |
  +---+---------------------------+
  | 1 | linda.ns.cloudflare.com.  |
  | 2 | carter.ns.cloudflare.com. |
  +---+---------------------------+
  =====================================================================

🧬 CMD: cname host_name

To view the canonical name (CNAME) for a host

$ traceip cname telnet.io
  =====================================================================
  canonical name (CNAME) for telnet.io
  +---+----------------+
  | - | CANONICAL NAME |
  +---+----------------+
  | 1 | park.io.       |
  +---+----------------+
  =====================================================================

πŸ”– Contributing

If you wish to contribute, feel free to reach out with ideas or questions for traceip or use the issues tab.

License

Copyright (c) Akash Chouhan. All rights reserved. Released under the MIT License

Releases

No releases published

Packages

No packages published