Database downloads

Seamlessly integrate the DB-IP database with your application.

The DB-IP Database

With more than 6 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
EditionSeptember 2014September 2014September 2014September 2014September 2014
Number of records225,3804,603,1285,438,9594,704,9166,596,446
Size (uncompressed)9 MB298 MB588 MB381 MB1,000 MB
FormatCSV [?]CSV [?]CSV [?]CSV [?]CSV [?]
Price***--$113$113$214
Free updates--12 months12 months12 months
Downloadfree downloadfree download

* 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 :


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

A free location database data import tool for Microsoft SQL Server.

It is available on github at the following address: Link

search