How does the IP address lookup tool work?

The IP Address Lookup page uses the free GeoLite2 City database from MaxMind. The database takes an IP address and gives its approximate location: city, region, country, time zone and coordinates. MaxMind updates it twice a week, and our server downloads the latest version every week with MaxMind's geoipupdate program.

In PHP, you can read the database with MaxMind's reader (install it with composer require maxmind-db/reader, or use the faster maxminddb PHP extension):

/* This code is public domain */
/* Source: https://ipaddr.es */

use MaxMind\Db\Reader;

$reader = new Reader('/var/lib/GeoIP/GeoLite2-City.mmdb');
$record = $reader->get($_SERVER['REMOTE_ADDR']);

echo $record['city']['names']['en'];          // Williamsburg
echo $record['subdivisions'][0]['names']['en']; // Virginia
echo $record['country']['names']['en'];       // United States
echo $record['location']['latitude'];         // 37.2438
echo $record['location']['longitude'];        // -76.7276

The map is an OpenStreetMap embed centred on those coordinates, which needs no API key.

Last updated: September 29, 2026 (12:40 AM GMT)