v3.13.0
- 标准化国内特殊行政区域的命名为长称:香港->香港特别行政区,澳门->澳门特别行政区等。
- 依据社区的一些反馈修正部分国内 IPv4 / IPv6 的定位信息。
- IPv4 和 IPv6 全部海外的定位信息更新为
2026/01版本,并且海外的定位信息全部映射为英文,国内的数据继续保持为中文,国家名字遵循iso-3166标准(除了 ”科索沃“ - 非官方代码XK),例如:77.97.180.0|77.97.180.255|United Kingdom|England|Yateley|0|GB。 - IPv4 和 IPv6 全部数据增加了
iso-3166-alpha2-code(国家两字母的简称) 字段,定位信息格式统一为国家|省份|城市|ISP|iso-3166-alpah2-code,例如:223.104.60.0|223.104.60.127|中国|广东省|深圳市|移动|CN。 - 全部的保留 IP 段的定位信息标准化为
Reserved|Reserved|Reserved|0|0。 - 全部 binding 的 README 中的测试定位信息更新为最新的数据。
xdb 二进制文件也使用最新数据重新生成了,请及时升级。
- fix the name of the CN special administrative region by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/423
- merge the update reports from the communitiy by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/424
- ipv4 data update on 2026/01 (overseas region update and with english,… by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/427
- V6 updates on 2026/01 with overseas region info updated and published in English ... by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/428
- Update readme demo tests result by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/429
- stdlize the Reserved IP region info by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/430
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.12.0...v3.13.0
v3.12.0
- 依据百度百科的行政规划信息修正国内部分地域信息的名字,详情请参考 https://github.com/lionsoul2014/ip2region/pull/415
- ipv4 数据的 ISP 名称标准化,详情请参考 https://github.com/lionsoul2014/ip2region/pull/416
- ipv6 数据移除应用场景字段并且替换为标准化的 ISP 信息,保持和 ipv4 完全相同的数据格式
国家|省份|城市|ISP,详情请参考 https://github.com/lionsoul2014/ip2region/pull/417 - 国内直辖市名字的标准化,例如,在省份索引位置的北京市/上海市等直辖市全部统一名字为 "北京/上海" 等去掉行政单位的名称,详情请参考 https://github.com/lionsoul2014/ip2region/pull/418
- ipv4 数据依据社区一些的反馈修正了
908个数据段的定位信息,主要是给国内的一些|中国|0|0|0数据段增加了省份和城市信息,其他的更新因为无法验证忽略掉了,详情请参考 https://github.com/lionsoul2014/ip2region/pull/419
- update the city name with the latest administrative info by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/415
- ipv4 source isp name stdlize by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/416
- remove the scene and replace it with stdlized isp for ipv6 data by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/417
- stdlize the municipality name by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/418
- update 908 segments based on the reports from community by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/419
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.11.2...v3.12.0
v3.11.2
- Java
LongByteArray增加固定切片支持,可以设置固定字节数的切片且可以更快的完成指定offset的寻址定位操作。 - Java xdb 内部的 content 缓存默认修改为固定切片的
LongByteArray实现,避免 content 缓存时的 OOM 错误减少峰值堆内存占用,默认的sliceBytes为Searcher.DEFAULT_SLICE_BYTES=50MiB。 - C#
ContentCacheStrategy直接实现ICacheStrategy接口减少启动时候的峰值内存占用。
- Fr java fixed slice bytes by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/411
- fix: Correct abnormal memory spikes by @vccddd in https://github.com/lionsoul2014/ip2region/pull/413
- @vccddd made their first contribution in https://github.com/lionsoul2014/ip2region/pull/413
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.11.1...v3.11.2
v3.11.1
- java xdb 内部的
String xdbPath全部替换为File xdbFile,支持通过File创建查询对象 - java xdb.Searcher 增加通过
InputStream加载整个 xdb 文件 / header / 验证 - java service.ConfigBuilder 增加
setXdbInputStream和setXdbFile,支持通过InputStream和File构建 service.Config - maven pom 版本更新为
3.3.1
- Ip2Region Config build from xdb File Object or xdb InputStream by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/408
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.11.0...v3.11.1
v3.11.0
- Java
Ip2Region服务类实现移动到org.lionsoul.ip2region.service包下。 - Java 的查询测试改用
Ip2Region查询服务来实现,默认使用data/ip2region_v4.xdb和data/ip2region_v6.xdb,可支持同时输入 IPv4 和 IPv6。 - Golang 增加
Ip2Region查询服务实现,并发安全支持且支持同时输入 IPv4 和 IPv6 的查询。 - Golang 的查询测试改用
Ip2Region查询服务来实现,默认使用data/ip2region_v4.xdb和data/ip2region_v6.xdb,可支持同时输入 IPv4 和 IPv6。
- Package all the classes into the service package. by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/404
- feat: add
Ip2Regionconcurrency safe search service by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/405 - Java search test driven by ip2region service by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/406
- Golang search test with ip2region service by @lionsoul2014 in https://github.com/lionsoul2014/ip2region/pull/407
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.10.0...v3.11.0
v3.10.0
- C++ IPv6 查询/生成/编辑器支持。
- Java
ip2region查询服务 - IP 版本自动判断且线程安全的查询服务,使用方式请参考 Java Binding ReadMe, Maven pom 版本更新为3.2.0。
- refactor and support ipv6 for binding maker and editor use C++ by @liuyunbin in https://github.com/lionsoul2014/ip2region/pull/403
- java
ip2regionsearcher service with IP version auto detect and Thread-safe search support by @lionsoul2014 , maven pom version upgrade to3.2.0.
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.9.0...v3.10.0
v3.9.0
该版本的核心功能是 C# IPv6 查询支持。
- feat: support IPv6 xdb by @ArgoZhang in https://github.com/lionsoul2014/ip2region/pull/399
- fix(NET): refactor GetData method by @ArgoZhang in https://github.com/lionsoul2014/ip2region/pull/401
Full Changelog: https://github.com/lionsoul2014/ip2region/compare/v3.8.1...v3.9.0
v3.8.1
ip2region 3.8.1 版本主要是一些 binding 的标准或者低版本支持,具体更新如下:
- c binding 支持
c99标准并且 Makefile 默认添加了-std=c99编译选项。 - lua_c binding 支持
c99标准同时完成了 lua >=5.1版本的兼容,Makefile 默认也添加了-std=c99编译选项,例如编译 Lua 5.1 版本的扩展:
# cd lua_c binding
make LuaVersion=5.1- python binding 完成了 Python >=
3.7版本的兼容,Pypi 版本号更新为3.0.2。
v3.8.0
- py_ip2region pypi 包支持:
pip3 install py-ip2region
util和searcher模块:
# 工具包模块,例如:ip 解析,版本信息,vectorIndex / buffer加载等
import ip2region.util as util
# xdb 查询实现模块
import ip2region.searcher as xdb
# 使用方式参考 python binding 的 ReadMe
- python binding 提供了对 IPv6 的查询支持,具体使用文档请参考 Python Binding,测试方式如下:
(.venv) ➜ python git:(master) python3 search_test.py --db=../../data/ip2region_v6.xdb
ip2region xdb searcher test program
source xdb: ../../data/ip2region_v6.xdb (IPv6, vectorIndex)
type 'quit' to exit
ip2region>> ::
{region: , ioCount: 1, took: 180 μs}
ip2region>> 240e:3b7:3272:d8d0:3b7b:3ee0:1d39:848
{region: 中国|广东省|深圳市|家庭宽带, ioCount: 8, took: 251 μs}
ip2region>> 2001:3:ffff:ffff:ffff:ffff:ffff:ffff
{region: 0|0|内网IP|内网IP, ioCount: 18, took: 474 μs}
ip2region>>
- 查询平均耗时:Razer 笔记本 / Ubuntu (电源均衡模式) + SATA SSD / VectorIndex 缓存,bench 结果如下:
(.venv) ➜ python git:(master) ✗ python3 bench_test.py --db=../../data/ip2region_v6.xdb --src=../../data/ipv6_source.txt --cache-policy=vectorIndex
searcher -> {"version": IPv6, "db_path": "../../data/ip2region_v6.xdb", "v_index": 524288, "c_buffer": None}
Bench finished, {cachePolicy: vectorIndex, total: 1614544, took: 65.378 s, cost: 40 μs/op}
161.45 万个 IPv6 平均查询耗时为 40 微秒/次。
v3.7.1
- 支持 xdb 3.0 的 binding 查询结果返回统一:查询出错保持原有的方式,找到了就返回字符串的
region信息,如果找不到指定 IP 的定位信息则返回空字符串"";原来的比较混乱,各种语言不统一,这对于一些自定义数据或者数据不完整的情况会出现,例如 ipv6 的原始数据就是从1:1::开始的,搜索::就会返回空。 - 支持 xdb 3.0 的 binding 中的 ReadMe 测试定位信息纠正,使用最新的 IPv6 纠正错误的定位信息。
- 支持 xdb 3.0 的 binding ReadMe 增加查询 API 的原型描述。
- binding 发行版本更新: Java:
<dependency>
<groupId>org.lionsoul</groupId>
<artifactId>ip2region</artifactId>
<version>3.1.1</version>
</dependency>npm 版本更新为 3.1.6