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
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.
- 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 andgo version
is updated. Refer the Go compilation guide.
$ 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.
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 |
+---+--------------+-----------------------------------+
=====================================================================
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 |
+---+--------------------------+----------------+
=====================================================================
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. |
+---+---------------------------+
=====================================================================
To view the canonical name (CNAME) for a host
$ traceip cname telnet.io
=====================================================================
canonical name (CNAME) for telnet.io
+---+----------------+
| - | CANONICAL NAME |
+---+----------------+
| 1 | park.io. |
+---+----------------+
=====================================================================
If you wish to contribute, feel free to reach out with ideas or questions for traceip or use the issues tab.
Copyright (c) Akash Chouhan. All rights reserved. Released under the MIT License