.
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 简介
2 |
3 | [**V2Ray**](https://github.com/v2fly/v2ray-core) 路由规则文件加强版,可代替 V2Ray 官方 `geoip.dat` 和 `geosite.dat`,适用于 [V2Ray](https://github.com/v2fly/v2ray-core)、[Xray-core](https://github.com/XTLS/Xray-core)、[mihomo](https://github.com/MetaCubeX/mihomo/tree/Meta)、[hysteria](https://github.com/apernet/hysteria)、[Trojan-Go](https://github.com/p4gefau1t/trojan-go)、[leaf](https://github.com/eycorsican/leaf)。使用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
4 |
5 | ## 规则文件生成方式
6 |
7 | ### geoip.dat
8 |
9 | - 通过仓库 [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip) 生成
10 | - 默认使用 [MaxMind GeoLite2 Country CSV 数据](https://github.com/Loyalsoldier/geoip/blob/release/GeoLite2-Country-CSV.zip)生成各个国家和地区的 GeoIP 文件。所有可供使用的国家和地区 geoip 类别(如 `geoip:cn`,两位英文字母表示国家或地区),请查看:[https://www.iban.com/country-codes](https://www.iban.com/country-codes)
11 | - 中国大陆 (`geoip:cn`) IPv4 地址数据融合了 [IPIP.net](https://github.com/17mon/china_ip_list/blob/master/china_ip_list.txt) 和 [@gaoyifan/china-operator-ip](https://github.com/gaoyifan/china-operator-ip/blob/ip-lists/china.txt)
12 | - 中国大陆 (`geoip:cn`) IPv6 地址数据融合了 MaxMind GeoLite2 和 [@gaoyifan/china-operator-ip](https://github.com/gaoyifan/china-operator-ip/blob/ip-lists/china6.txt)
13 | - 新增类别(方便有特殊需求的用户使用):
14 | - `geoip:cloudflare`
15 | - `geoip:cloudfront`
16 | - `geoip:facebook`
17 | - `geoip:fastly`
18 | - `geoip:google`
19 | - `geoip:netflix`
20 | - `geoip:telegram`
21 | - `geoip:twitter`
22 |
23 | > 希望定制 `geoip.dat` 文件?需要适用于其他代理软件的 GeoIP 格式文件?查看项目 [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)。
24 |
25 | ### geosite.dat
26 |
27 | - 基于 [@v2fly/domain-list-community/data](https://github.com/v2fly/domain-list-community/tree/master/data) 数据,通过仓库 [@Loyalsoldier/domain-list-custom](https://github.com/Loyalsoldier/domain-list-custom) 生成
28 | - **加入大量中国大陆域名、Apple 域名和 Google 域名**:
29 | - [@felixonmars/dnsmasq-china-list/accelerated-domains.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/accelerated-domains.china.conf) 加入到 `geosite:china-list` 和 `geosite:cn` 类别中
30 | - [@felixonmars/dnsmasq-china-list/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 加入到 `geosite:geolocation-!cn` 类别中(如希望本文件中的 Apple 域名直连,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1))
31 | - [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 加入到 `geosite:geolocation-!cn` 类别中(如希望本文件中的 Google 域名直连,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1))
32 | - **加入 GFWList 域名**:
33 | - 基于 [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist) 数据,通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成
34 | - 加入到 `geosite:gfw` 类别中,供习惯于 PAC 模式并希望使用 [GFWList](https://github.com/gfwlist/gfwlist) 的用户使用
35 | - 同时加入到 `geosite:geolocation-!cn` 类别中
36 | - **加入 EasyList 和 EasyListChina 广告域名**:通过 [@AdblockPlus/EasylistChina+Easylist.txt](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt) 获取并加入到 `geosite:category-ads-all` 类别中
37 | - **加入 AdGuard DNS Filter 广告域名**:通过 [@AdGuard/DNS-filter](https://kb.adguard.com/en/general/adguard-ad-filters#dns-filter) 获取并加入到 `geosite:category-ads-all` 类别中
38 | - **加入 Peter Lowe 广告和隐私跟踪域名**:通过 [@PeterLowe/adservers](https://pgl.yoyo.org/adservers) 获取并加入到 `geosite:category-ads-all` 类别中
39 | - **加入 Dan Pollock 广告域名**:通过 [@DanPollock/hosts](https://someonewhocares.org/hosts) 获取并加入到 `geosite:category-ads-all` 类别中
40 | - **加入 Windows 操作系统相关的系统升级和隐私跟踪域名**:
41 | - 基于 [@crazy-max/WindowsSpyBlocker](https://github.com/crazy-max/WindowsSpyBlocker/tree/master/data/hosts) 数据
42 | - [**慎用**] Windows 操作系统使用的隐私跟踪域名 [@crazy-max/WindowsSpyBlocker/hosts/spy.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/spy.txt) 加入到 `geosite:win-spy` 类别中
43 | - [**慎用**] Windows 操作系统使用的系统升级域名 [@crazy-max/WindowsSpyBlocker/hosts/update.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/update.txt) 加入到 `geosite:win-update` 类别中
44 | - [**慎用**] Windows 操作系统附加的隐私跟踪域名 [@crazy-max/WindowsSpyBlocker/hosts/extra.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/extra.txt) 加入到 `geosite:win-extra` 类别中
45 | - 关于这三个类别的使用方式,请参考下面 [geosite 的 Routing 配置方式](https://github.com/Loyalsoldier/v2ray-rules-dat#geositedat-1)
46 | - **可添加自定义直连、代理和广告域名**:由于上游域名列表更新缓慢或缺失某些域名,所以引入**需要添加的域名**列表。[`hidden 分支`](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里的三个文件 `direct.txt`、`proxy.txt` 和 `reject.txt`,分别存放自定义的需要添加的直连、代理、广告域名,最终分别加入到 `geosite:cn`、`geosite:geolocation-!cn` 和 `geosite:category-ads-all` 类别中
47 | - **可移除自定义直连、代理和广告域名**:由于上游域名列表存在需要被移除的域名,所以引入**需要移除的域名**列表。[`hidden 分支`](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里的三个文件 `direct-need-to-remove.txt`、`proxy-need-to-remove.txt` 和 `reject-need-to-remove.txt`,分别存放自定义的需要从 `direct-list`(直连域名列表)、`proxy-list`(代理域名列表)和 `reject-list`(广告域名列表) 移除的域名
48 |
49 | ## 规则文件下载地址
50 |
51 | > 如果无法访问域名 `raw.githubusercontent.com`,可以使用第二个地址 `cdn.jsdelivr.net`。
52 | > 如果无法访问域名 `cdn.jsdelivr.net`,可以将其替换为 `fastly.jsdelivr.net`。
53 | >
54 | > *.sha256sum 为校验文件。
55 |
56 | - **geoip.dat**:
57 | - [https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat)
58 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat)
59 | - **geosite.dat**:
60 | - [https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat)
61 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat)
62 | - **直连域名列表 direct-list.txt**:
63 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt)
64 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/direct-list.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/direct-list.txt)
65 | - **代理域名列表 proxy-list.txt**:
66 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt)
67 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/proxy-list.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/proxy-list.txt)
68 | - **广告域名列表 reject-list.txt**:
69 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt)
70 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/reject-list.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/reject-list.txt)
71 | - **@felixonmars/dnsmasq-china-list 仓库收集的在中国大陆可直连的域名列表 china-list.txt**:
72 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/china-list.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/china-list.txt)
73 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/china-list.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/china-list.txt)
74 | - **Apple 在中国大陆可直连的域名列表 apple-cn.txt**:
75 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/apple-cn.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/apple-cn.txt)
76 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/apple-cn.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/apple-cn.txt)
77 | - **Google 在中国大陆可直连的域名列表 google-cn.txt**:
78 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/google-cn.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/google-cn.txt)
79 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/google-cn.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/google-cn.txt)
80 | - **GFWList 域名列表 gfw.txt**:
81 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt)
82 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt)
83 | - **Windows 操作系统使用的隐私跟踪域名列表 win-spy.txt**:
84 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-spy.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-spy.txt)
85 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-spy.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-spy.txt)
86 | - **Windows 操作系统使用的系统升级域名列表 win-update.txt**:
87 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-update.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-update.txt)
88 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-update.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-update.txt)
89 | - **Windows 操作系统使用的附加隐私跟踪域名列表 win-extra.txt**:
90 | - [https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-extra.txt](https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/win-extra.txt)
91 | - [https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-extra.txt](https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/win-extra.txt)
92 |
93 | ## 规则文件使用方式
94 |
95 | ### geoip.dat
96 |
97 |
98 | 点击查看在 V2Ray 和 Xray-core 中的使用方法
99 |
100 | 需要先下载 geoip.dat
格式文件,并放置在程序目录内。
101 |
102 | ```json
103 | "routing": {
104 | "rules": [
105 | {
106 | "type": "field",
107 | "outboundTag": "Direct",
108 | "ip": [
109 | "geoip:cn",
110 | "geoip:private",
111 | "ext:cn.dat:cn",
112 | "ext:private.dat:private",
113 | "ext:geoip-only-cn-private.dat:cn",
114 | "ext:geoip-only-cn-private.dat:private"
115 | ]
116 | },
117 | {
118 | "type": "field",
119 | "outboundTag": "Proxy",
120 | "ip": [
121 | "geoip:us",
122 | "geoip:jp",
123 | "geoip:facebook",
124 | "geoip:telegram",
125 | "ext:geoip-asn.dat:facebook",
126 | "ext:geoip-asn.dat:telegram"
127 | ]
128 | }
129 | ]
130 | }
131 | ```
132 |
133 |
134 |
135 | 点击查看在 mihomo 中的使用方法
136 |
137 | ```yaml
138 | geodata-mode: true
139 | geox-url:
140 | geoip: "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
141 | ```
142 |
143 |
144 |
145 | 点击查看在 hysteria 中的使用方法
146 |
147 | 需要先下载 geoip.dat
格式文件,并放置在 hysteria 程序目录内。
148 |
149 | ```
150 | direct(geoip:cn)
151 | proxy(geoip:telegram)
152 | proxy(geoip:us)
153 | ```
154 |
155 |
156 |
157 | 点击查看在 Trojan-Go 中的使用方法
158 |
159 | 需要先下载 geoip.dat
格式文件,并放置在 Trojan-Go 程序目录内。
160 |
161 | ```json
162 | "router": {
163 | "enabled": true,
164 | "bypass": ["geoip:cn"],
165 | "proxy": ["geoip:telegram", "geoip:us"],
166 | "block": ["geoip:jp"],
167 | "default_policy": "proxy",
168 | "geoip": "./geoip.dat"
169 | }
170 | ```
171 |
172 |
173 | ### geosite.dat
174 |
175 | 跟 V2Ray 官方 `geosite.dat` 配置方式相同。相比官方 `geosite.dat` 文件,本项目特有的类别:
176 |
177 | - `geosite:china-list`:包含 [@felixonmars/dnsmasq-china-list/accelerated-domains.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/accelerated-domains.china.conf) 文件里的域名,供有特殊 DNS 分流需求的用户使用。
178 | - `geosite:apple-cn`:包含 [@felixonmars/dnsmasq-china-list/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 文件里的域名,供希望 Apple 域名直连(不走代理)的用户使用。
179 | - `geosite:google-cn`:包含 [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 文件里的域名,供希望 Google 域名直连(不走代理)的用户使用。
180 | - [**慎用**]`geosite:win-spy`:包含 [@crazy-max/WindowsSpyBlocker/hosts/spy.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/spy.txt) 文件里的域名,供希望屏蔽 Windows 操作系统隐私跟踪域名的用户使用。
181 | - [**慎用**]`geosite:win-update`:包含 [@crazy-max/WindowsSpyBlocker/hosts/update.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/update.txt) 文件里的域名,供希望屏蔽 Windows 操作系统自动升级的用户使用。
182 | - [**慎用**]`geosite:win-extra`:包含 [@crazy-max/WindowsSpyBlocker/hosts/extra.txt](https://github.com/crazy-max/WindowsSpyBlocker/blob/master/data/hosts/extra.txt) 文件里的域名,供希望屏蔽 Windows 操作系统附加隐私跟踪域名的用户使用。
183 |
184 | > ⚠️ 注意:在 Routing 配置中,类别越靠前(上),优先级越高,所以 `geosite:apple-cn` 和 `geosite:google-cn` 要放置在 `geosite:geolocation-!cn` 前(上)面才能生效。
185 |
186 | #### 高级用法
187 |
188 | v2fly/domain-list-community 项目 [data](https://github.com/v2fly/domain-list-community/tree/master/data) 目录中某些列表里的规则会被标记诸如 `@cn` 的 attribute(如下所示),意为该域名在中国大陆有接入点,可直连。
189 |
190 | ```
191 | steampowered.com.8686c.com @cn
192 | steamstatic.com.8686c.com @cn
193 | ```
194 |
195 | 对于玩 Steam 国区游戏,想要直连的用户,可以设置类别 `geosite:steam@cn` 为直连,意为将 [steam](https://github.com/v2fly/domain-list-community/blob/master/data/steam) 列表内所有被标记了 `@cn` attribute 的规则(域名)设置为直连。同理,由于 [category-games](https://github.com/v2fly/domain-list-community/blob/master/data/category-games) 列表包含了 `steam`、`ea`、`blizzard`、`epicgames` 和 `nintendo` 等常见的游戏厂商。设置类别 `geosite:category-games@cn` 为直连,即可节省大量服务器流量。
196 |
197 | > ⚠️ 注意:在 Routing 配置中,类别越靠前(上),优先级越高,所以 `geosite:category-games@cn` 等所有带有 `@cn` attribute 的规则都要放置在 `geosite:geolocation-!cn` 前(上)面才能生效。
198 | >
199 | > `category-games` 列表内的规则(域名)可能会有疏漏,请留意规则命中情况。如发现遗漏,欢迎到项目 v2fly/domain-list-community 提 [issue](https://github.com/v2fly/domain-list-community/issues) 反馈。
200 |
201 | #### 配置参考下面 👇👇👇
202 |
203 | **白名单模式 Routing 配置方式**:
204 |
205 | ```json
206 | "routing": {
207 | "rules": [
208 | {
209 | "type": "field",
210 | "outboundTag": "Reject",
211 | "domain": ["geosite:category-ads-all"]
212 | },
213 | {
214 | "type": "field",
215 | "outboundTag": "Direct",
216 | "domain": [
217 | "geosite:private",
218 | "geosite:apple-cn",
219 | "geosite:google-cn",
220 | "geosite:tld-cn",
221 | "geosite:category-games@cn"
222 | ]
223 | },
224 | {
225 | "type": "field",
226 | "outboundTag": "Proxy",
227 | "domain": ["geosite:geolocation-!cn"]
228 | },
229 | {
230 | "type": "field",
231 | "outboundTag": "Direct",
232 | "domain": ["geosite:cn"]
233 | },
234 | {
235 | "type": "field",
236 | "outboundTag": "Proxy",
237 | "network": "tcp,udp"
238 | }
239 | ]
240 | }
241 | ```
242 |
243 | **黑名单模式 Routing 配置方式:**
244 |
245 | ```json
246 | "routing": {
247 | "rules": [
248 | {
249 | "type": "field",
250 | "outboundTag": "Reject",
251 | "domain": ["geosite:category-ads-all"]
252 | },
253 | {
254 | "type": "field",
255 | "outboundTag": "Proxy",
256 | "domain": ["geosite:gfw"]
257 | },
258 | {
259 | "type": "field",
260 | "outboundTag": "Proxy",
261 | "ip": ["geoip:telegram"]
262 | },
263 | {
264 | "type": "field",
265 | "outboundTag": "Direct",
266 | "network": "tcp,udp"
267 | }
268 | ]
269 | }
270 | ```
271 |
272 | **DNS 配置方式**:
273 |
274 | ```json
275 | "dns": {
276 | "hosts": {
277 | "dns.google": "8.8.8.8",
278 | "dns.pub": "119.29.29.29",
279 | "dns.alidns.com": "223.5.5.5",
280 | "geosite:category-ads-all": "127.0.0.1"
281 | },
282 | "servers": [
283 | {
284 | "address": "https://1.1.1.1/dns-query",
285 | "domains": ["geosite:geolocation-!cn"],
286 | "expectIPs": ["geoip:!cn"]
287 | },
288 | "8.8.8.8",
289 | {
290 | "address": "114.114.114.114",
291 | "port": 53,
292 | "domains": ["geosite:cn", "geosite:category-games@cn"],
293 | "expectIPs": ["geoip:cn"],
294 | "skipFallback": true
295 | },
296 | {
297 | "address": "localhost",
298 | "skipFallback": true
299 | }
300 | ]
301 | }
302 | ```
303 |
304 | ### 自用 V2Ray v4 版本客户端配置(不适用于 V2Ray v5 及更新的版本)
305 |
306 | 注意事项:
307 |
308 | - 由于下面客户端配置的 DNS 使用了 `skipFallback` 选项,所以必须使用 v4.37.2 或更新版本的 [V2Ray](https://github.com/v2fly/v2ray-core/releases)
309 | - 下面客户端配置使 V2Ray 在本机开启 SOCKS 代理(监听 1080 端口)和 HTTP 代理(监听 2080 端口),允许局域网内其他设备连接并使用代理
310 | - BT 流量统统直连(实测依然会有部分 BT 流量走代理,如果服务商禁止 BT 下载,请不要为下载软件设置代理)
311 | - 最后,不命中任何路由规则的请求和流量,统统走代理
312 | - `outbounds` 里的第一个大括号内的配置,即为 V2Ray 代理服务的配置。请根据自身需求进行修改,并参照 V2Ray 官网配置文档中的 [配置 > Outbounds > OutboundObject](https://www.v2fly.org/config/outbounds.html#outboundobject) 部分进行补全
313 |
314 | ```jsonc
315 | {
316 | "log": {
317 | "loglevel": "warning"
318 | },
319 | "dns": {
320 | "hosts": {
321 | "dns.google": "8.8.8.8",
322 | "dns.pub": "119.29.29.29",
323 | "dns.alidns.com": "223.5.5.5",
324 | "geosite:category-ads-all": "127.0.0.1"
325 | },
326 | "servers": [
327 | {
328 | "address": "https://1.1.1.1/dns-query",
329 | "domains": ["geosite:geolocation-!cn", "geosite:google@cn"],
330 | "expectIPs": ["geoip:!cn"]
331 | },
332 | "8.8.8.8",
333 | {
334 | "address": "114.114.114.114",
335 | "port": 53,
336 | "domains": [
337 | "geosite:cn",
338 | "geosite:icloud",
339 | "geosite:category-games@cn"
340 | ],
341 | "expectIPs": ["geoip:cn"],
342 | "skipFallback": true
343 | },
344 | {
345 | "address": "localhost",
346 | "skipFallback": true
347 | }
348 | ]
349 | },
350 | "inbounds": [
351 | {
352 | "protocol": "socks",
353 | "listen": "0.0.0.0",
354 | "port": 1080,
355 | "tag": "Socks-In",
356 | "settings": {
357 | "ip": "127.0.0.1",
358 | "udp": true,
359 | "auth": "noauth"
360 | },
361 | "sniffing": {
362 | "enabled": true,
363 | "destOverride": ["http", "tls"]
364 | }
365 | },
366 | {
367 | "protocol": "http",
368 | "listen": "0.0.0.0",
369 | "port": 2080,
370 | "tag": "Http-In",
371 | "sniffing": {
372 | "enabled": true,
373 | "destOverride": ["http", "tls"]
374 | }
375 | }
376 | ],
377 | "outbounds": [
378 | {
379 | //下面这行,协议类别要改为socks、shadowsocks、vmess或vless等(记得删除本行文字说明)
380 | "protocol": "协议类别",
381 | "settings": {},
382 | //下面这行,tag的值对应Routing里的outboundTag,这里为Proxy(记得删除本行文字说明)
383 | "tag": "Proxy",
384 | "streamSettings": {},
385 | "mux": {}
386 | },
387 | {
388 | "protocol": "dns",
389 | "tag": "Dns-Out"
390 | },
391 | {
392 | "protocol": "freedom",
393 | "tag": "Direct",
394 | "settings": {
395 | "domainStrategy": "UseIPv4"
396 | }
397 | },
398 | {
399 | "protocol": "blackhole",
400 | "tag": "Reject",
401 | "settings": {
402 | "response": {
403 | "type": "http"
404 | }
405 | }
406 | }
407 | ],
408 | "routing": {
409 | "domainStrategy": "IPIfNonMatch",
410 | "domainMatcher": "mph",
411 | "rules": [
412 | {
413 | "type": "field",
414 | "outboundTag": "Direct",
415 | "protocol": ["bittorrent"]
416 | },
417 | {
418 | "type": "field",
419 | "outboundTag": "Dns-Out",
420 | "inboundTag": ["Socks-In", "Http-In"],
421 | "network": "udp",
422 | "port": 53
423 | },
424 | {
425 | "type": "field",
426 | "outboundTag": "Reject",
427 | "domain": ["geosite:category-ads-all"]
428 | },
429 | {
430 | "type": "field",
431 | "outboundTag": "Proxy",
432 | "domain": [
433 | "full:www.icloud.com",
434 | "domain:icloud-content.com",
435 | "geosite:google"
436 | ]
437 | },
438 | {
439 | "type": "field",
440 | "outboundTag": "Direct",
441 | "domain": [
442 | "geosite:tld-cn",
443 | "geosite:icloud",
444 | "geosite:category-games@cn"
445 | ]
446 | },
447 | {
448 | "type": "field",
449 | "outboundTag": "Proxy",
450 | "domain": ["geosite:geolocation-!cn"]
451 | },
452 | {
453 | "type": "field",
454 | "outboundTag": "Direct",
455 | "domain": ["geosite:cn", "geosite:private"]
456 | },
457 | {
458 | "type": "field",
459 | "outboundTag": "Direct",
460 | "ip": ["geoip:cn", "geoip:private"]
461 | },
462 | {
463 | "type": "field",
464 | "outboundTag": "Proxy",
465 | "network": "tcp,udp"
466 | }
467 | ]
468 | }
469 | }
470 | ```
471 |
472 | ## 致谢
473 |
474 | - [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
475 | - [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
476 | - [@Loyalsoldier/domain-list-custom](https://github.com/Loyalsoldier/domain-list-custom)
477 | - [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
478 | - [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist)
479 | - [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq)
480 | - [@AdblockPlus/EasylistChina+Easylist.txt](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
481 | - [@AdGuard/DNS-filter](https://kb.adguard.com/en/general/adguard-ad-filters#dns-filter)
482 | - [@PeterLowe/adservers](https://pgl.yoyo.org/adservers)
483 | - [@DanPollock/hosts](https://someonewhocares.org/hosts)
484 | - [@crazy-max/WindowsSpyBlocker](https://github.com/crazy-max/WindowsSpyBlocker)
485 |
486 | ## 项目 Star 数增长趋势
487 |
488 | [](https://starchart.cc/Loyalsoldier/v2ray-rules-dat)
489 |
--------------------------------------------------------------------------------