Free updated GeoIP legacy databases

Here you can find regularly updated versions of the discontinued GeoIP legacy databases. Many distributions still use old GeoIP libraries, so you might find these useful. I use these on many systems myself, so consider the files and site stable.

Conversion is done from Maxmind GeoLite2 databases, using slightly modified version of geolite2legacy. All names/locations are in plain US-ASCII encoding, converted from UTF-8 with Python unidecode module. Build process tries carefully not to create bad databases.


All files are provided with Creative Commons Attribution-ShareAlike 4.0 International License. Original GeoLite2 databases are distributed with the same license.


18.09.2022 - added IPv4 mappings to IPv6 databases.

GeoIPv6.dat, GeoIPCityv6.dat, GeoIPASNumv6.dat can now be queried with IPv4 mapped addresses (e.g. ::ffff:, so they can be used with Nginx (some info here, here, here). Cheers to Adrian M for the hint.

29.05.2022 - v0.24.

Check for new path /usr/libexec/xtables-addons/xt_geoip_build, found in Ubuntu 22.04.

01.07.2020 - added GeoIPOrg and GeoIPISP databases.

They contain identical Organization info, taken from GeoLite2 ASN database. These can be used for example Apache HTTP server mod_geoip module, which is not able to read ASN format database. Using "GeoIPDBFile GeoIPOrg.dat" will enable GEOIP_ORGANIZATION environment variable.

24.05.2020 - v0.23.

Fixes xtables-addons 3.8+ requiring csv in dbip format. Found in Ubuntu 20.04 for example. What a stupid way to break things, since their xt_geoip_build script could have easily detected which format is fed.. now even the input filename is hardcoded, pfft.


It's enough to download these once a week. Unpack to /usr/share/GeoIP or equivalent directory.

You can use my script if needed, instructions found within. Always carefully audit any downloaded scripts!

Latest update: 28 January 2023
GeoIP.dat.gzGeoIP Country IPv4 database.
GeoIPv6.dat.gzGeoIP Country IPv6 database.
GeoIPCity.dat.gzGeoIP City IPv4 database.
GeoIPCityv6.dat.gzGeoIP City IPv6 database.
GeoIPASNum.dat.gzGeoIP ASN IPv4 database.
GeoIPASNumv6.dat.gzGeoIP ASN IPv6 database.
GeoIPISP.dat.gzGeoIP ISP IPv4 database.
GeoIPOrg.dat.gzGeoIP Organization IPv4 database.
GeoIP-legacy.csv.gzGeoIP Country for iptables xt_geoip module (use
CSV built with GeoLite2xtables.
geoip_update.shExample download script.
build.logCurrent build log for all files.


In case of problems, contact: