Skip to content

Latest commit

 

History

History
129 lines (104 loc) · 3.82 KB

File metadata and controls

129 lines (104 loc) · 3.82 KB

Merged IP Database

A Go program that merges multiple IP geolocation databases into a single, comprehensive MMDB file. The merged database combines the best data from each source using priority-based field-level merging.

Data Sources

Source Primary Use Coverage
GeoLite2-City Country, city, coordinates, timezone, subdivisions, multi-language names IPv4 + IPv6
GeoLite2-ASN ASN fallback (secondary) IPv4 + IPv6
IPinfo Lite ASN, AS organization, AS domain (primary) IPv4 + IPv6
DB-IP City Supplementary geo data IPv4 + IPv6
RouteViews ASN ASN fallback (tertiary) IPv4 + IPv6
GeoLite2-Geo-Whois-ASN-Country Country fallback IPv4 + IPv6
QQWry (Chunzhen) Enhanced Chinese IP geolocation with native zh-CN names IPv4
OpenProxyDB Proxy, VPN, Tor, hosting, and CDN detection IPv4 + IPv6

Output Format

The merged database contains the following fields:

{
  "city": {
    "geoname_id": <uint32>,
    "names": { "en": "...", "de": "...", ... }
  },
  "continent": {
    "code": "...",
    "geoname_id": <uint32>,
    "names": { "en": "...", "de": "...", ... }
  },
  "country": {
    "geoname_id": <uint32>,
    "iso_code": "...",
    "names": { "en": "...", "de": "...", ... }
  },
  "location": {
    "accuracy_radius": <uint16>,
    "latitude": <double>,
    "longitude": <double>,
    "metro_code": <uint16>,
    "time_zone": "..."
  },
  "postal": {
    "code": "..."
  },
  "registered_country": {
    "geoname_id": <uint32>,
    "iso_code": "...",
    "names": { "en": "...", "de": "...", ... }
  },
  "subdivisions": [
    {
      "geoname_id": <uint32>,
      "iso_code": "...",
      "names": { "en": "...", "de": "...", ... }
    }
  ],
  "asn": {
    "autonomous_system_number": <uint32>,
    "autonomous_system_organization": "...",
    "as_domain": "..."
  },
  "proxy": {
    "is_proxy": <bool>,
    "is_vpn": <bool>,
    "is_tor": <bool>,
    "is_hosting": <bool>,
    "is_cdn": <bool>,
    "is_school": <bool>,
    "is_anonymous": <bool>
  }
}

Download

Download the latest merged database from Releases:

wget https://github.com/NetworkCats/Merged-IP-Data/releases/latest/download/Merged-IP.mmdb

Building from Source

Prerequisites

  • Go 1.25 or later

Build

git clone https://github.com/NetworkCats/Merged-IP-Data.git
cd Merged-IP-Data
go build -o merge-tool ./cmd/merge

Run

# Download databases and merge
./merge-tool

# Use existing downloaded databases
./merge-tool -skip-download

# Custom output path
./merge-tool -output custom.mmdb

Automatic Updates

The database is automatically updated daily at 1:00 UTC via GitHub Actions. Each release includes:

  • The merged MMDB file
  • Release notes with data source information

License

This project merges data from multiple sources. Please refer to each source's license:

The merge tool source code is provided as-is for educational and personal use.