Database downloads

Seamlessly integrate the DB-IP database with your application.

The DB-IP Database

With more than 7 million IPv4 and IPv6 blocks, this is one of the most comprehensive and accurate IP address databases available on the market.

Every month, hundreds of thousands of records are added or updated, and we're always working hard to improve the coverage of our database and its accuracy.

Here you will find everything you need to seamlessly integrate the DB-IP database with your application.



Database downloads


  IP address to countryIP address to city (low resolution)IP address to locationIP address to ISPIP address to location + ISP
Country
State/Province**
City**
Latitude/Longitude
Timezone
ISP name
Connection type*
Organization
EditionJuly 2015July 2015July 2015July 2015July 2015
Number of records288,6865,457,8156,531,9205,345,0277,921,460
Size (uncompressed)13 MB351 MB708 MB441 MB1,229 MB
FormatCSV [?]CSV [?]CSV [?]CSV [?]CSV [?]
Price***--$100$100$188
Free updates--12 months12 months12 months
DownloadFreeFreeBuy NowBuy NowBuy Now

* when available
** lower precision than the IP-location database
*** approximation based on the latest exchange rates, final price is determined by PayPal



File formats

All the downloadable IP to ISP and geolocation database files are in the Comma Separated Values format, with the following fields:

IP-country database

ip_start, ip_end, country

IP-city database

ip_start, ip_end, country, stateprov, city

IP-location database

ip_start, ip_end, country, stateprov, city, latitude, longitude, timezone_offset, timezone_name

IP-ISP database

ip_start, ip_end, country, isp_name, connection_type, organization_name

Full IP database

ip_start, ip_end, country, stateprov, city, latitude, longitude, timezone_offset, timezone_name, isp_name, connection_type, organization_name


MySQL scripts

These are the MySQL table creation statements for the lookup table needed by our PHP code, use the one that match your database type :

IP-country database

CREATE TABLE `dbip_lookup` (
  `addr_type` enum('ipv4','ipv6') NOT NULL,
  `ip_start` varbinary(16) NOT NULL,
  `ip_end` varbinary(16) NOT NULL,
  `country` char(2) NOT NULL,
  PRIMARY KEY (`ip_start`)
);

IP-city database

CREATE TABLE `dbip_lookup` (
  `addr_type` enum('ipv4','ipv6') NOT NULL,
  `ip_start` varbinary(16) NOT NULL,
  `ip_end` varbinary(16) NOT NULL,
  `country` char(2) NOT NULL,
  `stateprov` varchar(80) NOT NULL,
  `city` varchar(80) NOT NULL,
  PRIMARY KEY (`ip_start`)
);

IP-location database

CREATE TABLE `dbip_lookup` (
  `addr_type` enum('ipv4','ipv6') NOT NULL,
  `ip_start` varbinary(16) NOT NULL,
  `ip_end` varbinary(16) NOT NULL,
  `country` char(2) NOT NULL,
  `stateprov` varchar(80) NOT NULL,
  `city` varchar(80) NOT NULL,
  `latitude` float NOT NULL,
  `longitude` float NOT NULL,
  `timezone_offset` float NOT NULL,
  `timezone_name` varchar(64) NOT NULL,
  PRIMARY KEY (`ip_start`)
);

IP-ISP database

CREATE TABLE `dbip_lookup` (
  `addr_type` enum('ipv4','ipv6') NOT NULL,
  `ip_start` varbinary(16) NOT NULL,
  `ip_end` varbinary(16) NOT NULL,
  `country` char(2) NOT NULL,
  `isp_name` varchar(128) NOT NULL,
  `connection_type` enum('dialup','isdn','cable','dsl','fttx','wireless') DEFAULT NULL,
  `organization_name` varchar(128) NOT NULL,
  PRIMARY KEY (`ip_start`)
);

Full IP database

CREATE TABLE `dbip_lookup` (
  `addr_type` enum('ipv4','ipv6') NOT NULL,
  `ip_start` varbinary(16) NOT NULL,
  `ip_end` varbinary(16) NOT NULL,
  `country` char(2) NOT NULL,
  `stateprov` varchar(80) NOT NULL,
  `city` varchar(80) NOT NULL,
  `latitude` float NOT NULL,
  `longitude` float NOT NULL,
  `timezone_offset` float NOT NULL,
  `timezone_name` varchar(64) NOT NULL,
  `isp_name` varchar(128) NOT NULL,
  `connection_type` enum('dialup','isdn','cable','dsl','fttx','wireless') DEFAULT NULL,
  `organization_name` varchar(128) NOT NULL,
  PRIMARY KEY (`ip_start`)
);


PHP source code

This package contains the core DB-IP PHP class, a CSV database import tool, and sample lookup code.

  dbip-phpsrc-1.4.tgz



External links

These packages are not maintained by the DB-IP team but we have selected them because they provide added functionnality or language support.


ZORAN.DB.IP.Importer

ZORAN.DB.IP.Importer is a tool that imports into Microsoft SQL Server the freely available geolocation database offered by www.db-ip.com.

ZORAN.DB.IP.Importer on GitHub


Geolocal

Geocode IP addresses with a single Ruby if statement. No network access, no context switches, no delay, just one low-calorie lookup like Geolocal.in_spain?(request.remote_ip).

500,000 individual lookups per second is fairly typical performance.

Geolocal on GitHub

search