Using Nmap with IP2Location


Nmap (Network Mapper) is a free and open-source network scanner created by Gordon Lyon. It is a valuable tool in the arsenal of a network administrator to probe networks and much more. To enhance the functionality of Nmap with IP2Location, we have created a script to return geolocation information about the Nmap target. This script uses the IP2Location BIN database files which comes in the free LITE form as well as the commercial form.

Download free LITE BIN files at

Download paid BIN files at

How to install the IP2Location script in Nmap

We will show the steps required for Debian Linux.

How to use Nmap with IP2Location

Run the following command to call Nmap with the IP2Location results. In this example, we are probing on port 80 to check its status. The IP address associated with will be used to query the IP2Location BIN file to get its geolocation information.

nmap --script ip-geolocation-ip2location -p80 --script-args ip-geolocation-ip2location.ip2location_db=/myfolder/DB25.BIN

You will see the following as the result of the command.

Starting Nmap 7.40 ( ) at 2019-04-08 07:07 UTC
country_short: US
country_long: United States of America
region: Virginia
city: Ashburn
isp: Amazon Technologies Inc.
latitude: 39.039474
longitude: -77.491806
zipcode: 20146
timezone: -04:00
netspeed: T1
iddcode: 1
areacode: 703
weatherstationcode: USVA0027
weatherstationname: Ashburn
mcc: –
mnc: –
mobilebrand: –
elevation: 89
usagetype: DCH
addresstype: U
category: IAB19-11
Nmap scan report for (
Host is up (0.00053s latency).
Other addresses for (not scanned): 2600:1f18:45b0:5b00:f5d8:4183:7710:ceec
rDNS record for
80/tcp open http

Nmap done: 1 IP address (1 host up) scanned in 0.22 seconds


We believe that by combining the flexibility of Nmap with the power of geolocation data by IP2Location, network administrators will now have a more potent tool to keep their networks safe from any malicious actors.

Was this article helpful?

Related Articles