geoip2-cn is a GeoIP2 database generator that produces compact, China-focused IP geolocation data for proxy tools.
The project addresses limitations in the standard MaxMind GeoLite2 database used by proxy applications. GeoLite2 requires registration to download, contains global IP data making it large and slow to load, and has poor accuracy for Chinese mainland IP addresses. The tool solves this by merging and deduplicating Chinese IP address ranges from ipip.net and Chunzhen databases, generating a GeoIP2 database containing only mainland China IP information. The resulting database is approximately 100 KB, compared to the original 4 MB, enabling faster loading and query performance.
The tool suits users in mainland China who need to route traffic based on whether destination IPs belong to Chinese territory. It is designed for proxy applications including Surge, Shadowrocket, QuantumultX, and Clash. The project also provides an IP-CIDR list format for older proxy tools and firewalls. Downloads are available via GitHub raw links or CDN distribution for faster access in various network conditions.
The project maintains automated updates every three days with no manual intervention required. Development activity centers on keeping the IP database current and accurate through continuous integration of upstream data sources.