Skip to content
Provides geographical location to netstat.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Where is my Mac connected to ?

What Application is using that connection ?

Geo-Netstat is a program you run in your terminal and it provides a geographical location for your application's internet connections.

alt text

Tested on MacOS Sierra.

This product includes GeoLite2 data created by MaxMind, available from

How to compile libmaxminddb:

$ git clone --recursive
$ cd libmaxminddb
$ ./bootstrap
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig

How to install the databases:

Go to

Download these archives:
'GeoLite2 City'
'GeoLite2 Country'
'GeoLite2 ASN'

Uncompress in a folder and copy the folder to a location on your system.
The location is set in geo-netstat.h:

#define MMDB_ASN_DB      "/usr/local/db/GeoLite2-ASN.mmdb"
#define MMDB_CITY_DB     "/usr/local/db/GeoLite2-City.mmdb"
#define MMDB_COUNTRY_DB  "/usr/local/db/GeoLite2-Country.mmdb"

How to compile geo-netstat:

$ gcc -o geo-netstat -L/usr/local/lib/ -I/usr/local/include/ geo-netstat.c -lmaxminddb

How to install geo-netstat:

$ sudo mv geo-netstat /usr/local/bin


Geo-Netstat outputs a json datafile with latitude, longitude and magnitude which can be loaded into WebGL-Globe.


What can be improved (by you ?):

  • a more detailed geographical location
  • do fancy things with webgl-globe
  • add an update timer and refresh terminal
  • support for IPv6
  • update data from the maxmind database
You can’t perform that action at this time.