English | 简体中文 | Русский | فارسی
GeoIP and GeoSite data for Xray.
GeoIP is based on IPinfo Lite, supplemented with IP data for regional routing needs and commonly used services. Both IPv4 and IPv6 are supported.
GeoSite currently uses upstream data from v2fly/domain-list-community without modification.
Builds run daily at 18:00 UTC (02:00 the next day in China, 21:00 in Moscow, Russia, and 21:30 in Iran).
| Data | File | Contents | GitHub Releases | jsDelivr mirrors |
|---|---|---|---|---|
| GeoIP full | geoip-full.dat |
Original categories for all countries and territories, regional custom sets, blocklists, and common categories | Download | File too large |
| GeoIP lite | geoip-lite.dat |
Regional custom sets, blocklists, and common categories, with compatibility aliases | Download | Default / Fastly |
| GeoSite | geosite.dat |
Domain category data | Download | Default / Fastly |
* Xray releases include GeoSite and GeoIP lite, named geosite.dat and geoip.dat, respectively.
| Category | Name or scope | Full | Lite |
|---|---|---|---|
| Original country and territory categories | Original IPinfo data for all countries and territories | Included | Not included |
| Anycast addresses | anycast |
Included | Not included |
| Regional custom sets | in-cn, in-ru, in-ir |
Included | Included |
| Blocklists | blacklist-ru, blacklist-ir |
Included | Included |
| Common categories | private, cloudflare, cloudfront, facebook, fastly, google, netflix, telegram, twitter, tor |
Included | Included |
| Compatibility aliases | cn → in-cn, ru → in-ru, ir → in-ir |
Not provided | Provided |
See the GeoIP documentation for the category design and data sources.
If you only need specific categories, download their files individually without downloading the larger geoip-full.dat.
For example, keep using the lite version as geoip.dat; the existing in-cn category remains available through geoip:in-cn. Download us.dat into the same directory to use the us category through ext:us.dat:us.
Individual category DAT files are available in the geoip/dat/ directory on the release branch.
The full version includes the following 250 country and territory categories.
Show the complete list (sorted by code)
GitHub Releases only provides single-file DAT databases. For manual downloads, open the latest release. Older versions are available on GitHub Releases.
Automatic updaters can download the latest version from the following fixed URL. Replace <filename> with the appropriate file name:
https://github.com/XTLS/Xray-rules-dat/releases/latest/download/<filename>
The latest versions of all files are published on the release branch. When you need a specific category, download its file directly from this branch.
Replace <path> with the file path within the branch, such as geoip/dat/us.dat:
- GitHub Raw:
https://raw.githubusercontent.com/XTLS/Xray-rules-dat/release/<path> - jsDelivr mirror (default):
https://cdn.jsdelivr.net/gh/XTLS/Xray-rules-dat@release/<path> - jsDelivr mirror (Fastly):
https://fastly.jsdelivr.net/gh/XTLS/Xray-rules-dat@release/<path>
jsDelivr mirrors have a per-file size limit, so even individual category files may be too large to download. Prefer GitHub Releases or GitHub Raw, and use mirrors when GitHub is inaccessible.
Each data file has a corresponding .sha256sum checksum file in the same location.
Xray releases include GeoIP lite as geoip.dat. Its regional custom sets and common categories can be used directly.
The following example keeps the lite version as geoip.dat and downloads us.dat into the same directory.
Merge the following snippet into your Xray configuration to automatically update and hot-reload both files daily at 04:00 in the runtime environment’s local time. Private addresses and the in-cn category use the existing direct outbound, while the us category uses the existing wireguard outbound:
{
"geodata": {
"cron": "0 4 * * *",
"assets": [
{
"url": "https://github.com/XTLS/Xray-rules-dat/releases/latest/download/geoip-lite.dat",
"file": "geoip.dat"
},
{
"url": "https://raw.githubusercontent.com/XTLS/Xray-rules-dat/release/geoip/dat/us.dat",
"file": "us.dat"
}
]
},
"routing": {
"rules": [
{
"ip": ["geoip:private", "geoip:in-cn"],
"outboundTag": "direct"
},
{
"ip": ["ext:us.dat:us"],
"outboundTag": "wireguard"
}
]
}
}The files to be updated must already exist. See the Geodata configuration documentation for more options.
Replace the category names in the example as needed. See Xray’s routing documentation for rule order and IP matching behavior.
The existing in-cn category remains available through geoip:in-cn, and the additional us category is loaded through ext:us.dat:us. For other categories, replace us in both the file name and category name.
The category name after the last colon must exist in that DAT file. See loading IPs from a file in the Xray documentation.
To use original categories for more countries and territories, you can also download geoip-full.dat, rename it to geoip.dat, and replace the existing file. Also change geoip-lite.dat to geoip-full.dat in the update URL above. After replacing the file, you can use original categories directly, such as geoip:us, without downloading us.dat separately or using ext:us.dat:us.
GeoIP source code, data sources, and build steps are maintained on the geoip branch.
This project is licensed under GPL-3.0.
- The GeoIP source code was forked from
Meo597/geoip@56a84321, which was forked fromLoyalsoldier/geoip@b84c0db4 - IPInfo Lite
- zhufengme/block_cn_files
- misakaio/chnroutes2
- gaoyifan/china-operator-ip
- bgptools/anycast-prefixes
- Chocolate4U/Iran-v2ray-rules
- runetfreedom/russia-blocked-geoip
- hxehex/russia-mobile-internet-whitelist
- Antifilter
- 1andrevich/Re-filter-lists
- v2fly/domain-list-community: upstream GeoSite data
