[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71540":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":10,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":45,"readmeContent":46,"aiSummary":47,"trendingCount":15,"starSnapshotCount":15,"syncStatus":48,"lastSyncTime":49,"discoverSource":50},71540,"v2ray-rules-dat","Loyalsoldier\u002Fv2ray-rules-dat","Loyalsoldier","🦄 🎃 👻 V2Ray 路由规则文件加强版，可代替 V2Ray 官方 geoip.dat 和 geosite.dat，适用于 V2Ray、Xray-core、mihomo(Clash-Meta)、hysteria、Trojan-Go 和 leaf。Enhanced edition of V2Ray rules dat files, applicable to V2Ray, Xray-core, mihomo(Clash-Meta), hysteria, Trojan-Go and leaf.","",null,19990,2631,150,9,0,43,90,294,129,45,"GNU General Public License v3.0",false,"master",[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"adblock","adguard","anticensorship","chinalist","dnsmasq","easylist","geoip","geosite","gfw","gfwlist","hysteria","ipv4","ipv6","mihomo","proxy","routing","trojan","trojan-go","v2ray","xray","2026-06-12 02:02:53","# 简介 ![GitHub Downloads (all assets, all releases)](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fdownloads\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Ftotal?logo=github) ![GitHub Downloads (all assets, latest release)](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fdownloads\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Flatest\u002Ftotal?logo=github) [![jsdelivr stats](https:\u002F\u002Fdata.jsdelivr.com\u002Fv1\u002Fpackage\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Fbadge?style=rounded)](https:\u002F\u002Fwww.jsdelivr.com\u002Fpackage\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat)\n\n[**V2Ray**](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fv2ray-core) 路由规则文件加强版，可代替 V2Ray 官方 `geoip.dat` 和 `geosite.dat`，适用于 [V2Ray](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fv2ray-core)、[Xray-core](https:\u002F\u002Fgithub.com\u002FXTLS\u002FXray-core)、[mihomo](https:\u002F\u002Fgithub.com\u002FMetaCubeX\u002Fmihomo\u002Ftree\u002FMeta)、[hysteria](https:\u002F\u002Fgithub.com\u002Fapernet\u002Fhysteria)、[Trojan-Go](https:\u002F\u002Fgithub.com\u002Fp4gefau1t\u002Ftrojan-go)、[leaf](https:\u002F\u002Fgithub.com\u002Feycorsican\u002Fleaf)。使用 GitHub Actions 北京时间每天早上 6 点自动构建，保证规则最新。\n\n## 规则文件生成方式\n\n### geoip.dat\n\n- 通过仓库 [@Loyalsoldier\u002Fgeoip](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fgeoip) 生成\n- 默认使用 [MaxMind GeoLite2 Country CSV 数据](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fgeoip\u002Fblob\u002Frelease\u002FGeoLite2-Country-CSV.zip)生成各个国家和地区的 GeoIP 文件。所有可供使用的国家和地区 geoip 类别（如 `geoip:cn`，两位英文字母表示国家或地区），请查看：[https:\u002F\u002Fwww.iban.com\u002Fcountry-codes](https:\u002F\u002Fwww.iban.com\u002Fcountry-codes)\n- 中国大陆 (`geoip:cn`) IPv4 地址数据融合了 [IPIP.net](https:\u002F\u002Fgithub.com\u002F17mon\u002Fchina_ip_list\u002Fblob\u002Fmaster\u002Fchina_ip_list.txt) 和 [@gaoyifan\u002Fchina-operator-ip](https:\u002F\u002Fgithub.com\u002Fgaoyifan\u002Fchina-operator-ip\u002Fblob\u002Fip-lists\u002Fchina.txt)\n- 中国大陆 (`geoip:cn`) IPv6 地址数据融合了 MaxMind GeoLite2 和 [@gaoyifan\u002Fchina-operator-ip](https:\u002F\u002Fgithub.com\u002Fgaoyifan\u002Fchina-operator-ip\u002Fblob\u002Fip-lists\u002Fchina6.txt)\n- 新增类别（方便有特殊需求的用户使用）：\n  - `geoip:cloudflare`\n  - `geoip:cloudfront`\n  - `geoip:facebook`\n  - `geoip:fastly`\n  - `geoip:google`\n  - `geoip:netflix`\n  - `geoip:telegram`\n  - `geoip:twitter`\n\n> 希望定制 `geoip.dat` 文件？需要适用于其他代理软件的 GeoIP 格式文件？查看项目 [@Loyalsoldier\u002Fgeoip](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fgeoip)。\n\n### geosite.dat\n\n- 基于 [@v2fly\u002Fdomain-list-community\u002Fdata](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community\u002Ftree\u002Fmaster\u002Fdata) 数据，通过仓库 [@Loyalsoldier\u002Fdomain-list-custom](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fdomain-list-custom) 生成\n- **加入大量中国大陆域名、Apple 域名和 Google 域名**：\n  - [@felixonmars\u002Fdnsmasq-china-list\u002Faccelerated-domains.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Faccelerated-domains.china.conf) 加入到 `geosite:china-list` 和 `geosite:cn` 类别中\n  - [@felixonmars\u002Fdnsmasq-china-list\u002Fapple.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Fapple.china.conf) 加入到 `geosite:geolocation-!cn` 类别中（如希望本文件中的 Apple 域名直连，请参考下面 [geosite 的 Routing 配置方式](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat#geositedat-1)）\n  - [@felixonmars\u002Fdnsmasq-china-list\u002Fgoogle.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Fgoogle.china.conf) 加入到 `geosite:geolocation-!cn` 类别中（如希望本文件中的 Google 域名直连，请参考下面 [geosite 的 Routing 配置方式](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat#geositedat-1)）\n- **加入 GFWList 域名**：\n  - 基于 [@gfwlist\u002Fgfwlist](https:\u002F\u002Fgithub.com\u002Fgfwlist\u002Fgfwlist) 数据，通过仓库 [@cokebar\u002Fgfwlist2dnsmasq](https:\u002F\u002Fgithub.com\u002Fcokebar\u002Fgfwlist2dnsmasq) 生成\n  - 加入到 `geosite:gfw` 类别中，供习惯于 PAC 模式并希望使用 [GFWList](https:\u002F\u002Fgithub.com\u002Fgfwlist\u002Fgfwlist) 的用户使用\n  - 同时加入到 `geosite:geolocation-!cn` 类别中\n- **加入 EasyList 和 EasyListChina 广告域名**：通过 [@AdblockPlus\u002FEasylistChina+Easylist.txt](https:\u002F\u002Feasylist-downloads.adblockplus.org\u002Feasylistchina+easylist.txt) 获取并加入到 `geosite:category-ads-all` 类别中\n- **加入 AdGuard DNS Filter 广告域名**：通过 [@AdGuard\u002FDNS-filter](https:\u002F\u002Fkb.adguard.com\u002Fen\u002Fgeneral\u002Fadguard-ad-filters#dns-filter) 获取并加入到 `geosite:category-ads-all` 类别中\n- **加入 Peter Lowe 广告和隐私跟踪域名**：通过 [@PeterLowe\u002Fadservers](https:\u002F\u002Fpgl.yoyo.org\u002Fadservers) 获取并加入到 `geosite:category-ads-all` 类别中\n- **加入 Dan Pollock 广告域名**：通过 [@DanPollock\u002Fhosts](https:\u002F\u002Fsomeonewhocares.org\u002Fhosts) 获取并加入到 `geosite:category-ads-all` 类别中\n- **加入 Windows 操作系统相关的系统升级和隐私跟踪域名**：\n  - 基于 [@crazy-max\u002FWindowsSpyBlocker](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Ftree\u002Fmaster\u002Fdata\u002Fhosts) 数据\n  - [**慎用**] Windows 操作系统使用的隐私跟踪域名 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fspy.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fspy.txt) 加入到 `geosite:win-spy` 类别中\n  - [**慎用**] Windows 操作系统使用的系统升级域名 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fupdate.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fupdate.txt) 加入到 `geosite:win-update` 类别中\n  - [**慎用**] Windows 操作系统附加的隐私跟踪域名 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fextra.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fextra.txt) 加入到 `geosite:win-extra` 类别中\n  - 关于这三个类别的使用方式，请参考下面 [geosite 的 Routing 配置方式](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat#geositedat-1)\n- **可添加自定义直连、代理和广告域名**：由于上游域名列表更新缓慢或缺失某些域名，所以引入**需要添加的域名**列表。[`hidden 分支`](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Ftree\u002Fhidden)里的三个文件 `direct.txt`、`proxy.txt` 和 `reject.txt`，分别存放自定义的需要添加的直连、代理、广告域名，最终分别加入到 `geosite:cn`、`geosite:geolocation-!cn` 和 `geosite:category-ads-all` 类别中\n- **可移除自定义直连、代理和广告域名**：由于上游域名列表存在需要被移除的域名，所以引入**需要移除的域名**列表。[`hidden 分支`](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Ftree\u002Fhidden)里的三个文件 `direct-need-to-remove.txt`、`proxy-need-to-remove.txt` 和 `reject-need-to-remove.txt`，分别存放自定义的需要从 `direct-list`（直连域名列表）、`proxy-list`（代理域名列表）和 `reject-list`（广告域名列表） 移除的域名\n\n## 规则文件下载地址\n\n> 如果无法访问域名 `raw.githubusercontent.com`，可以使用第二个地址 `cdn.jsdelivr.net`。\n> 如果无法访问域名 `cdn.jsdelivr.net`，可以将其替换为 `fastly.jsdelivr.net`。\n>\n> *.sha256sum 为校验文件。\n\n- **geoip.dat**：\n  - [https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Freleases\u002Flatest\u002Fdownload\u002Fgeoip.dat](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Freleases\u002Flatest\u002Fdownload\u002Fgeoip.dat)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgeoip.dat](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgeoip.dat)\n- **geosite.dat**：\n  - [https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Freleases\u002Flatest\u002Fdownload\u002Fgeosite.dat](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Freleases\u002Flatest\u002Fdownload\u002Fgeosite.dat)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgeosite.dat](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgeosite.dat)\n- **直连域名列表 direct-list.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fdirect-list.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fdirect-list.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fdirect-list.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fdirect-list.txt)\n- **代理域名列表 proxy-list.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fproxy-list.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fproxy-list.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fproxy-list.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fproxy-list.txt)\n- **广告域名列表 reject-list.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Freject-list.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Freject-list.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Freject-list.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Freject-list.txt)\n- **@felixonmars\u002Fdnsmasq-china-list 仓库收集的在中国大陆可直连的域名列表 china-list.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fchina-list.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fchina-list.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fchina-list.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fchina-list.txt)\n- **Apple 在中国大陆可直连的域名列表 apple-cn.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fapple-cn.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fapple-cn.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fapple-cn.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fapple-cn.txt)\n- **Google 在中国大陆可直连的域名列表 google-cn.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fgoogle-cn.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fgoogle-cn.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgoogle-cn.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgoogle-cn.txt)\n- **GFWList 域名列表 gfw.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fgfw.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fgfw.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgfw.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgfw.txt)\n- **Windows 操作系统使用的隐私跟踪域名列表 win-spy.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-spy.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-spy.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-spy.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-spy.txt)\n- **Windows 操作系统使用的系统升级域名列表 win-update.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-update.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-update.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-update.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-update.txt)\n- **Windows 操作系统使用的附加隐私跟踪域名列表 win-extra.txt**：\n  - [https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-extra.txt](https:\u002F\u002Fraw.githubusercontent.com\u002FLoyalsoldier\u002Fv2ray-rules-dat\u002Frelease\u002Fwin-extra.txt)\n  - [https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-extra.txt](https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fwin-extra.txt)\n\n## 规则文件使用方式\n\n### geoip.dat\n\n\u003Cdetails>\n  \u003Csummary>点击查看在 \u003Cb>V2Ray\u003C\u002Fb> 和 \u003Cb>Xray-core\u003C\u002Fb> 中的使用方法\u003C\u002Fsummary>\n  \u003Cbr\u002F>\n  \u003Cp>需要先下载 \u003Ccode>geoip.dat\u003C\u002Fcode> 格式文件，并放置在程序目录内。\u003C\u002Fp>\n\n```json\n\"routing\": {\n  \"rules\": [\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Direct\",\n      \"ip\": [\n        \"geoip:cn\",\n        \"geoip:private\",\n        \"ext:cn.dat:cn\",\n        \"ext:private.dat:private\",\n        \"ext:geoip-only-cn-private.dat:cn\",\n        \"ext:geoip-only-cn-private.dat:private\"\n      ]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Proxy\",\n      \"ip\": [\n        \"geoip:us\",\n        \"geoip:jp\",\n        \"geoip:facebook\",\n        \"geoip:telegram\",\n        \"ext:geoip-asn.dat:facebook\",\n        \"ext:geoip-asn.dat:telegram\"\n      ]\n    }\n  ]\n}\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>点击查看在 \u003Cb>mihomo\u003C\u002Fb> 中的使用方法\u003C\u002Fsummary>\n\n```yaml\ngeodata-mode: true\ngeox-url:\n  geoip: \"https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002FLoyalsoldier\u002Fv2ray-rules-dat@release\u002Fgeoip.dat\"\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>点击查看在 \u003Cb>hysteria\u003C\u002Fb> 中的使用方法\u003C\u002Fsummary>\n  \u003Cbr\u002F>\n  \u003Cp>需要先下载 \u003Ccode>geoip.dat\u003C\u002Fcode> 格式文件，并放置在 hysteria 程序目录内。\u003C\u002Fp>\n\n```\ndirect(geoip:cn)\nproxy(geoip:telegram)\nproxy(geoip:us)\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>点击查看在 \u003Cb>Trojan-Go\u003C\u002Fb> 中的使用方法\u003C\u002Fsummary>\n  \u003Cbr\u002F>\n  \u003Cp>需要先下载 \u003Ccode>geoip.dat\u003C\u002Fcode> 格式文件，并放置在 Trojan-Go 程序目录内。\u003C\u002Fp>\n\n```json\n\"router\": {\n  \"enabled\": true,\n  \"bypass\": [\"geoip:cn\"],\n  \"proxy\": [\"geoip:telegram\", \"geoip:us\"],\n  \"block\": [\"geoip:jp\"],\n  \"default_policy\": \"proxy\",\n  \"geoip\": \".\u002Fgeoip.dat\"\n}\n```\n\u003C\u002Fdetails>\n\n### geosite.dat\n\n跟 V2Ray 官方 `geosite.dat` 配置方式相同。相比官方 `geosite.dat` 文件，本项目特有的类别：\n\n- `geosite:china-list`：包含 [@felixonmars\u002Fdnsmasq-china-list\u002Faccelerated-domains.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Faccelerated-domains.china.conf) 文件里的域名，供有特殊 DNS 分流需求的用户使用。\n- `geosite:apple-cn`：包含 [@felixonmars\u002Fdnsmasq-china-list\u002Fapple.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Fapple.china.conf) 文件里的域名，供希望 Apple 域名直连（不走代理）的用户使用。\n- `geosite:google-cn`：包含 [@felixonmars\u002Fdnsmasq-china-list\u002Fgoogle.china.conf](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list\u002Fblob\u002Fmaster\u002Fgoogle.china.conf) 文件里的域名，供希望 Google 域名直连（不走代理）的用户使用。\n- [**慎用**]`geosite:win-spy`：包含 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fspy.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fspy.txt) 文件里的域名，供希望屏蔽 Windows 操作系统隐私跟踪域名的用户使用。\n- [**慎用**]`geosite:win-update`：包含 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fupdate.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fupdate.txt) 文件里的域名，供希望屏蔽 Windows 操作系统自动升级的用户使用。\n- [**慎用**]`geosite:win-extra`：包含 [@crazy-max\u002FWindowsSpyBlocker\u002Fhosts\u002Fextra.txt](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker\u002Fblob\u002Fmaster\u002Fdata\u002Fhosts\u002Fextra.txt) 文件里的域名，供希望屏蔽 Windows 操作系统附加隐私跟踪域名的用户使用。\n\n> ⚠️ 注意：在 Routing 配置中，类别越靠前（上），优先级越高，所以 `geosite:apple-cn` 和 `geosite:google-cn` 要放置在 `geosite:geolocation-!cn` 前（上）面才能生效。\n\n#### 高级用法\n\nv2fly\u002Fdomain-list-community 项目 [data](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community\u002Ftree\u002Fmaster\u002Fdata) 目录中某些列表里的规则会被标记诸如 `@cn` 的 attribute（如下所示），意为该域名在中国大陆有接入点，可直连。\n\n```\nsteampowered.com.8686c.com @cn\nsteamstatic.com.8686c.com @cn\n```\n\n对于玩 Steam 国区游戏，想要直连的用户，可以设置类别 `geosite:steam@cn` 为直连，意为将 [steam](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community\u002Fblob\u002Fmaster\u002Fdata\u002Fsteam) 列表内所有被标记了 `@cn` attribute 的规则（域名）设置为直连。同理，由于 [category-games](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community\u002Fblob\u002Fmaster\u002Fdata\u002Fcategory-games) 列表包含了 `steam`、`ea`、`blizzard`、`epicgames` 和 `nintendo` 等常见的游戏厂商。设置类别 `geosite:category-games@cn` 为直连，即可节省大量服务器流量。\n\n> ⚠️ 注意：在 Routing 配置中，类别越靠前（上），优先级越高，所以 `geosite:category-games@cn` 等所有带有 `@cn` attribute 的规则都要放置在 `geosite:geolocation-!cn` 前（上）面才能生效。\n> \n> `category-games` 列表内的规则（域名）可能会有疏漏，请留意规则命中情况。如发现遗漏，欢迎到项目 v2fly\u002Fdomain-list-community 提 [issue](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community\u002Fissues) 反馈。\n\n#### 配置参考下面 👇👇👇\n\n**白名单模式 Routing 配置方式**：\n\n```json\n\"routing\": {\n  \"rules\": [\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Reject\",\n      \"domain\": [\"geosite:category-ads-all\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Direct\",\n      \"domain\": [\n        \"geosite:private\",\n        \"geosite:apple-cn\",\n        \"geosite:google-cn\",\n        \"geosite:tld-cn\",\n        \"geosite:category-games@cn\"\n      ]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Proxy\",\n      \"domain\": [\"geosite:geolocation-!cn\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Direct\",\n      \"domain\": [\"geosite:cn\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Proxy\",\n      \"network\": \"tcp,udp\"\n    }\n  ]\n}\n```\n\n**黑名单模式 Routing 配置方式：**\n\n```json\n\"routing\": {\n  \"rules\": [\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Reject\",\n      \"domain\": [\"geosite:category-ads-all\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Proxy\",\n      \"domain\": [\"geosite:gfw\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Proxy\",\n      \"ip\": [\"geoip:telegram\"]\n    },\n    {\n      \"type\": \"field\",\n      \"outboundTag\": \"Direct\",\n      \"network\": \"tcp,udp\"\n    }\n  ]\n}\n```\n\n**DNS 配置方式**：\n\n```json\n\"dns\": {\n  \"hosts\": {\n    \"dns.google\": \"8.8.8.8\",\n    \"dns.pub\": \"119.29.29.29\",\n    \"dns.alidns.com\": \"223.5.5.5\",\n    \"geosite:category-ads-all\": \"127.0.0.1\"\n  },\n  \"servers\": [\n    {\n      \"address\": \"https:\u002F\u002F1.1.1.1\u002Fdns-query\",\n      \"domains\": [\"geosite:geolocation-!cn\"],\n      \"expectIPs\": [\"geoip:!cn\"]\n    },\n    \"8.8.8.8\",\n    {\n      \"address\": \"114.114.114.114\",\n      \"port\": 53,\n      \"domains\": [\"geosite:cn\", \"geosite:category-games@cn\"],\n      \"expectIPs\": [\"geoip:cn\"],\n      \"skipFallback\": true\n    },\n    {\n      \"address\": \"localhost\",\n      \"skipFallback\": true\n    }\n  ]\n}\n```\n\n### 自用 V2Ray v4 版本客户端配置（不适用于 V2Ray v5 及更新的版本）\n\n注意事项：\n\n- 由于下面客户端配置的 DNS 使用了 `skipFallback` 选项，所以必须使用 v4.37.2 或更新版本的 [V2Ray](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fv2ray-core\u002Freleases)\n- 下面客户端配置使 V2Ray 在本机开启 SOCKS 代理（监听 1080 端口）和 HTTP 代理（监听 2080 端口），允许局域网内其他设备连接并使用代理\n- BT 流量统统直连（实测依然会有部分 BT 流量走代理，如果服务商禁止 BT 下载，请不要为下载软件设置代理）\n- 最后，不命中任何路由规则的请求和流量，统统走代理\n- `outbounds` 里的第一个大括号内的配置，即为 V2Ray 代理服务的配置。请根据自身需求进行修改，并参照 V2Ray 官网配置文档中的 [配置 > Outbounds > OutboundObject](https:\u002F\u002Fwww.v2fly.org\u002Fconfig\u002Foutbounds.html#outboundobject) 部分进行补全\n\n```jsonc\n{\n  \"log\": {\n    \"loglevel\": \"warning\"\n  },\n  \"dns\": {\n    \"hosts\": {\n      \"dns.google\": \"8.8.8.8\",\n      \"dns.pub\": \"119.29.29.29\",\n      \"dns.alidns.com\": \"223.5.5.5\",\n      \"geosite:category-ads-all\": \"127.0.0.1\"\n    },\n    \"servers\": [\n      {\n        \"address\": \"https:\u002F\u002F1.1.1.1\u002Fdns-query\",\n        \"domains\": [\"geosite:geolocation-!cn\", \"geosite:google@cn\"],\n        \"expectIPs\": [\"geoip:!cn\"]\n      },\n      \"8.8.8.8\",\n      {\n        \"address\": \"114.114.114.114\",\n        \"port\": 53,\n        \"domains\": [\n          \"geosite:cn\",\n          \"geosite:icloud\",\n          \"geosite:category-games@cn\"\n        ],\n        \"expectIPs\": [\"geoip:cn\"],\n        \"skipFallback\": true\n      },\n      {\n        \"address\": \"localhost\",\n        \"skipFallback\": true\n      }\n    ]\n  },\n  \"inbounds\": [\n    {\n      \"protocol\": \"socks\",\n      \"listen\": \"0.0.0.0\",\n      \"port\": 1080,\n      \"tag\": \"Socks-In\",\n      \"settings\": {\n        \"ip\": \"127.0.0.1\",\n        \"udp\": true,\n        \"auth\": \"noauth\"\n      },\n      \"sniffing\": {\n        \"enabled\": true,\n        \"destOverride\": [\"http\", \"tls\"]\n      }\n    },\n    {\n      \"protocol\": \"http\",\n      \"listen\": \"0.0.0.0\",\n      \"port\": 2080,\n      \"tag\": \"Http-In\",\n      \"sniffing\": {\n        \"enabled\": true,\n        \"destOverride\": [\"http\", \"tls\"]\n      }\n    }\n  ],\n  \"outbounds\": [\n    {\n      \u002F\u002F下面这行，协议类别要改为socks、shadowsocks、vmess或vless等（记得删除本行文字说明）\n      \"protocol\": \"协议类别\",\n      \"settings\": {},\n      \u002F\u002F下面这行，tag的值对应Routing里的outboundTag，这里为Proxy（记得删除本行文字说明）\n      \"tag\": \"Proxy\",\n      \"streamSettings\": {},\n      \"mux\": {}\n    },\n    {\n      \"protocol\": \"dns\",\n      \"tag\": \"Dns-Out\"\n    },\n    {\n      \"protocol\": \"freedom\",\n      \"tag\": \"Direct\",\n      \"settings\": {\n        \"domainStrategy\": \"UseIPv4\"\n      }\n    },\n    {\n      \"protocol\": \"blackhole\",\n      \"tag\": \"Reject\",\n      \"settings\": {\n        \"response\": {\n          \"type\": \"http\"\n        }\n      }\n    }\n  ],\n  \"routing\": {\n    \"domainStrategy\": \"IPIfNonMatch\",\n    \"domainMatcher\": \"mph\",\n    \"rules\": [\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Direct\",\n        \"protocol\": [\"bittorrent\"]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Dns-Out\",\n        \"inboundTag\": [\"Socks-In\", \"Http-In\"],\n        \"network\": \"udp\",\n        \"port\": 53\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Reject\",\n        \"domain\": [\"geosite:category-ads-all\"]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Proxy\",\n        \"domain\": [\n          \"full:www.icloud.com\",\n          \"domain:icloud-content.com\",\n          \"geosite:google\"\n        ]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Direct\",\n        \"domain\": [\n          \"geosite:tld-cn\",\n          \"geosite:icloud\",\n          \"geosite:category-games@cn\"\n        ]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Proxy\",\n        \"domain\": [\"geosite:geolocation-!cn\"]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Direct\",\n        \"domain\": [\"geosite:cn\", \"geosite:private\"]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Direct\",\n        \"ip\": [\"geoip:cn\", \"geoip:private\"]\n      },\n      {\n        \"type\": \"field\",\n        \"outboundTag\": \"Proxy\",\n        \"network\": \"tcp,udp\"\n      }\n    ]\n  }\n}\n```\n\n## 致谢\n\n- [@Loyalsoldier\u002Fgeoip](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fgeoip)\n- [@v2fly\u002Fdomain-list-community](https:\u002F\u002Fgithub.com\u002Fv2fly\u002Fdomain-list-community)\n- [@Loyalsoldier\u002Fdomain-list-custom](https:\u002F\u002Fgithub.com\u002FLoyalsoldier\u002Fdomain-list-custom)\n- [@felixonmars\u002Fdnsmasq-china-list](https:\u002F\u002Fgithub.com\u002Ffelixonmars\u002Fdnsmasq-china-list)\n- [@gfwlist\u002Fgfwlist](https:\u002F\u002Fgithub.com\u002Fgfwlist\u002Fgfwlist)\n- [@cokebar\u002Fgfwlist2dnsmasq](https:\u002F\u002Fgithub.com\u002Fcokebar\u002Fgfwlist2dnsmasq)\n- [@AdblockPlus\u002FEasylistChina+Easylist.txt](https:\u002F\u002Feasylist-downloads.adblockplus.org\u002Feasylistchina+easylist.txt)\n- [@AdGuard\u002FDNS-filter](https:\u002F\u002Fkb.adguard.com\u002Fen\u002Fgeneral\u002Fadguard-ad-filters#dns-filter)\n- [@PeterLowe\u002Fadservers](https:\u002F\u002Fpgl.yoyo.org\u002Fadservers)\n- [@DanPollock\u002Fhosts](https:\u002F\u002Fsomeonewhocares.org\u002Fhosts)\n- [@crazy-max\u002FWindowsSpyBlocker](https:\u002F\u002Fgithub.com\u002Fcrazy-max\u002FWindowsSpyBlocker)\n\n## 项目 Star 数增长趋势\n\n[![Stargazers over time](https:\u002F\u002Fstarchart.cc\u002FLoyalsoldier\u002Fv2ray-rules-dat.svg)](https:\u002F\u002Fstarchart.cc\u002FLoyalsoldier\u002Fv2ray-rules-dat)\n","该项目提供了增强版的V2Ray路由规则文件，可替代官方的`geoip.dat`和`geosite.dat`，适用于V2Ray、Xray-core、mihomo(Clash-Meta)、hysteria、Trojan-Go及leaf等软件。其核心功能包括每日自动更新规则文件，确保数据最新，并且扩展了多种实用的GeoIP类别如`cloudflare`、`google`等，以及增加了大量中国大陆域名和常用国际服务域名。特别适合需要精细化网络流量控制与加速的场景，比如提高访问国内外网站的速度或绕过某些地区的网络限制。",2,"2026-06-11 03:38:22","high_star"]