Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mmdb_china_ip_list

> 编程语言
Open source

Geoip MaxMind Database for china ip list! This is also an example of generating MaxMind Database!

1.1K stars0 likes0 views
WebsiteGitHub

About

Geoip MaxMind Database for china ip list! This is also an example of generating MaxMind Database!

mmdb_china_ip_list

README | English Document

将china_ip_list、纯真CN、Clang.CN、ali AS37963和ios_rule_script cloudcn发布的中国IP列表叠加到MaxMind官方社区版数据库中。

同时,这也是一个如何生成MaxMind数据库的示例。

适合在网络分流工具中使用,对中国IP的匹配分流更为友好,兼容MaxMind DB的客户端!

每周自动拉取新的MaxMind、china_ip_list、纯真CN和Clang.cn数据库,并发布一个新的Release版本。

包含的社区 CN IP数据库

  • china_ip_list
  • Chunzhen CN: IPv4
  • Clang CN: IPv4 ,IPv6
  • China Operator: IPv4 ,IPv6
  • ios_rule_script CloudCN: IPv4&IPv6

完整版和Lite版区别

版本 官方非 CN IPv4 官方非CN IPv6 社区 CN IPv4 社区 CN IPv6 元数据
完整版 ✅ ✅ ✅ ✅ All
Lite 版 - - ✅ ✅ 仅iso_code和geoname_id
  • 官方非 CN: 读取 MaxMind 官方 CSV 文件跳过了 CN 的记录
  • Lite版本仅写入了iso_code和geoname_id以达到缩小体积的目的

固定下载连接

文件 release分支 CDN
Country.mmdb 链接 链接
Country.mmdb lite 链接 链接
version 链接 链接

不好意思,阿里云到期了续不起,国内镜像暂时先下了,优先用CDN吧!

简介

在网络分流工具(例如Clash)中使用MaxMind的GeoLite2-Country对中国IP的匹配不是很友好,实际使用中出现不少问题。

此项目,在MaxMind数据库的基础上,加入了china_ip_list、纯真CN和Clang.CN的数据。ipv6使用Clang.cn的数据,使得对中国IP匹配得更为友好。

由于构建mmdb,后者覆盖前者的特性,ip列表的插入顺序如下:

  1. Clang.CN
  2. 纯真CN数据库
  3. china_ip_list

使用

下载生成的Country.mmdb。

使用方式同MaxMind官方API,可参考指导文档。

OpenClash中使用

下载生成的Country.mmdb,然后替换掉/etc/openclash/Country.mmdb,最后重启下clash即可。

Perl版本构建指导

需要perl环境,MaxMind-DB-Writer-perl的依赖和使用可以参考官方文档。

…

生成的文件为china_ip_list.mmdb。

MaxMind GeoIP 格式

官方对自己的数据库中的内容说明很少,都是自己一点点跟代码找出来的格式,然后据此生成的数据库。

下面列出所有字段示例供参考。

头

json
{
    "database_type": "GeoLite2-Country",
    "binary_format_major_version": 2,
    "build_epoch": 1589304057,
    "ip_version": 6,
    "languages": [
        "de",
        "en",
        "es",
        "fr",
        "ja",
        "pt-BR",
        "ru",
        "zh-CN"
    ],
    "description": {
        "en": "GeoLite2 Country database"
    },
    "record_size": 24,
    "node_count": 616946,
    "binary_format_minor_version": 0
}

network->字段

…

感谢

  • Jetbrains Open Source Development License

  • GeoIP MaxMind DB 生成指南

  • GeoLite Mirror | Sukka

  • 使用 GeoLite 实现IP精准定位(Java实现)

  • Loyalsoldier提供的GeoLite2-Country-CSV下载链接

  • JMVoid 的 Golang 版本 mmdb writer 使用示例

其他

摸索不易,引用整合或者二次发布还望留个名......

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gochinaclashgeoipgeoip2

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言