Skip to content

Commit 66213fb

Browse files
committed
优化 ecs 和 client_subnet 配置
1 parent fb17f36 commit 66213fb

16 files changed

Lines changed: 59 additions & 98 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# 对下载源的说明
1818
1. 本教程默认下载源为 [jsDelivr 源](https://www.jsdelivr.com/github),格式为 `https://cdn.jsdelivr.net/gh/[username]/[reponame]@[branchname]/[filename]`,此源中**文件更新有 12 小时延迟**
19-
2. 若 jsDelivr 源无法访问,可将地址改为 `https://fastly.jsdelivr.net/gh/[username]/[reponame]@[branchname]/[filename]`
19+
2. 若 jsDelivr 源无法访问,可将地址改为 `https://testingcf.jsdelivr.net/gh/[username]/[reponame]@[branchname]/[filename]`
2020
3. 推荐使用 [GitHub 源](https://github.com),格式分别为 `https://github.com/[username]/[reponame]/releases/download/[tagname]/[filename]`(推荐)、`https://raw.githubusercontent.com/[username]/[reponame]/[tagname]/[filename]``https://raw.githubusercontent.com/[username]/[reponame]/[branchname]/[filename]`
2121
4. 若 GitHub 源无法访问,可添加 `https://ghfast.top/` 前缀,即:将地址分别改为 `https://ghfast.top/https://github.com/[username]/[reponame]/releases/download/[tagname]/[filename]`(推荐)、`https://ghfast.top/https://raw.githubusercontent.com/[username]/[reponame]/[tagname]/[filename]``https://ghfast.top/https://raw.githubusercontent.com/[username]/[reponame]/[branchname]/[filename]`
2222

_posts/2024-08-21-dnsnoleaks-mihomo-geodata.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ geosite.dat 文件须包含 `fakeip-filter`、`cn` 和 `proxy`,推荐导入我
2323
## 三、 DNS 防泄漏配置
2424
### 1. DNS 模式为 `mix`(推荐)
2525
连接 SSH 后执行 `vi $CRASHDIR/yamls/user.yaml`,按一下 Ins 键(Insert 键),粘贴如下内容:
26-
>推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP`202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`
26+
>推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS`211.137.58.20`,可设置为 `211.137.58.0/24`
2727
{: .prompt-info }
2828

2929
```yaml
@@ -42,9 +42,9 @@ dns:
4242
- MATCH,real-ip
4343
respect-rules: true
4444
nameserver:
45-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
46-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
47-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
45+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
46+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
47+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
4848
proxy-server-nameserver: [system]
4949
direct-nameserver: [system]
5050
```
@@ -81,7 +81,7 @@ dns:
8181

8282
### 3. DNS 模式为 `redir-host`
8383
连接 SSH 后执行 `vi $CRASHDIR/yamls/user.yaml`,按一下 Ins 键(Insert 键),粘贴如下内容:
84-
>推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
84+
>推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
8585
{: .prompt-info }
8686

8787
```yaml
@@ -95,9 +95,9 @@ dns:
9595
fake-ip-filter: ['+.*']
9696
respect-rules: true
9797
nameserver:
98-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
99-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
100-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
98+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
99+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
100+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
101101
proxy-server-nameserver: [system]
102102
direct-nameserver: [system]
103103
```

_posts/2024-08-21-dnsnoleaks-mihomo-ruleset.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ rule-providers:
5050
## 三、 DNS 防泄漏配置
5151
### 1. DNS 模式为 `mix`(推荐)
5252
连接 SSH 后执行 `vi $CRASHDIR/yamls/user.yaml`,按一下 Ins 键(Insert 键),粘贴如下内容:
53-
>推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
53+
>推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
5454
{: .prompt-info }
5555

5656
```yaml
@@ -69,9 +69,9 @@ dns:
6969
- MATCH,real-ip
7070
respect-rules: true
7171
nameserver:
72-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
73-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
74-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
72+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
73+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
74+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
7575
proxy-server-nameserver: [system]
7676
direct-nameserver: [system]
7777
```
@@ -110,7 +110,7 @@ dns:
110110

111111
### 3. DNS 模式为 `redir-host`
112112
连接 SSH 后执行 `vi $CRASHDIR/yamls/user.yaml`,按一下 Ins 键(Insert 键),粘贴如下内容:
113-
>推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
113+
>推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
114114
{: .prompt-info }
115115

116116
```yaml
@@ -124,9 +124,9 @@ dns:
124124
fake-ip-filter: ['+.*']
125125
respect-rules: true
126126
nameserver:
127-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
128-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
129-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
127+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
128+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
129+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
130130
proxy-server-nameserver: [system]
131131
direct-nameserver: [system]
132132
```

_posts/2024-08-21-share-android-mihomo-ruleset.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ proxy-groups:
302302

303303
注:
304304
- 1. 本 `dns` 配置中,仅国外域名 `proxy` 走 `fake-ip`,直连域名(含国内域名 `cn`)走国内 DNS 解析,未知域名走国外 DNS 解析(有效解决了“心理 DNS 泄露问题”,详见《[搭载 mihomo 内核配置 DNS 不泄露教程-ruleset 方案](https://proxy-tutorials.dustinwin.us.kg/posts/dnsnoleaks-mihomo-ruleset/)》),且配置 `ecs` 提高了兼容性
305-
- 2. 推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`
305+
- 2. 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
306306

307307
```yaml
308308
hosts: {miwifi.com: [192.168.31.1, 127.0.0.1]}
@@ -317,9 +317,9 @@ dns:
317317
fake-ip-filter: ['rule-set:proxy']
318318
respect-rules: true
319319
nameserver:
320-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
321-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
322-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
320+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
321+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
322+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
323323
proxy-server-nameserver: [system]
324324
direct-nameserver: [system]
325325
nameserver-policy: {'rule-set:ads': [rcode://success]}

_posts/2024-08-21-share-android-singboxr-ruleset.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ tags: [sing-box, sing-boxr, Android, ruleset, rule_set, 分享]
307307

308308
注:
309309
- 1.`dns` 配置中,国外域名 `proxy``fake-ip`,私有网络 `private` 和国内域名 `cn` 走国内 DNS 解析,未知域名走国外 DNS 解析(有效解决了“心理 DNS 泄露问题”,详见《[搭载 sing-boxr 内核配置 DNS 不泄露教程-ruleset 方案](https://proxy-tutorials.dustinwin.us.kg/posts/dnsnoleaks-singboxr-ruleset/)》),且配置 `client_subnet` 提高了兼容性
310-
- 2. 推荐将 `client_subnet` 设置为当前网络的公网 IP 段,如当前网络公网 IP`202.103.17.123`,可设置为 `202.103.17.0/24`
310+
- 2. 推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS`211.137.58.20`,可设置为 `211.137.58.0/24`
311311

312312
```json
313313
{
@@ -332,8 +332,8 @@ tags: [sing-box, sing-boxr, Android, ruleset, rule_set, 分享]
332332
"strategy": "prefer_ipv4",
333333
"independent_cache": true,
334334
"reverse_mapping": true,
335-
// 推荐将 `client_subnet` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`
336-
"client_subnet": "202.103.17.0/24"
335+
// 推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS 的 IP
336+
"client_subnet": "211.137.58.0/24"
337337
}
338338
}
339339
```

_posts/2024-08-21-share-shellcrash-mihomo-geodata.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ dns:
197197

198198
注:
199199
- 1. 本 `dns` 配置中,仅国外域名 `proxy` 走 `fake-ip`,直连域名(含国内域名 `cn`)走国内 DNS 解析,未知域名走国外 DNS 解析(有效解决了“心理 DNS 泄露问题”,详见《[搭载 mihomo 内核配置 DNS 不泄露教程-geodata 方案](https://proxy-tutorials.dustinwin.us.kg/posts/dnsnoleaks-mihomo-geodata/)》),且配置 `ecs` 提高了兼容性
200-
- 2. 推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
200+
- 2. 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
201201

202202
```yaml
203203
hosts: {miwifi.com: [192.168.31.1, 127.0.0.1]}
@@ -213,21 +213,14 @@ dns:
213213
fake-ip-filter: ['geosite:proxy']
214214
respect-rules: true
215215
nameserver:
216-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
217-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
218-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
216+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
217+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
218+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
219219
proxy-server-nameserver: [system]
220220
direct-nameserver: [system]
221221
nameserver-policy: {'geosite:ads': [rcode://success]}
222222
```
223223
224-
**新增定时任务**
225-
连接 SSH 后执行命令 `vi $CRASHDIR/task/task.user`,按一下 Ins 键(Insert 键),粘贴如下内容:
226-
227-
```shell
228-
204#sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml >/dev/null 2>&1#更新ecs地址
229-
```
230-
231224
---
232225
233226
## 五、 添加定时任务

_posts/2024-08-21-share-shellcrash-mihomo-ruleset.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ dns:
294294

295295
注:
296296
- 1. 本 `dns` 配置中,仅国外域名 `proxy` 走 `fake-ip`,直连域名(含国内域名 `cn`)走国内 DNS 解析,未知域名走国外 DNS 解析(有效解决了“心理 DNS 泄露问题”,详见《[搭载 mihomo 内核配置 DNS 不泄露教程-ruleset 方案](https://proxy-tutorials.dustinwin.us.kg/posts/dnsnoleaks-mihomo-ruleset/)》),且配置 `ecs` 提高了兼容性
297-
- 2. 推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
297+
- 2. 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
298298

299299
```yaml
300300
hosts: {miwifi.com: [192.168.31.1, 127.0.0.1]}
@@ -310,21 +310,14 @@ dns:
310310
fake-ip-filter: ['rule-set:proxy']
311311
respect-rules: true
312312
nameserver:
313-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
314-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
315-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
313+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
314+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
315+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
316316
proxy-server-nameserver: [system]
317317
direct-nameserver: [system]
318318
nameserver-policy: {'rule-set:ads': [rcode://success]}
319319
```
320320
321-
**新增定时任务**
322-
连接 SSH 后执行命令 `vi $CRASHDIR/task/task.user`,按一下 Ins 键(Insert 键),粘贴如下内容:
323-
324-
```shell
325-
203#sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml >/dev/null 2>&1#更新ecs地址
326-
```
327-
328321
---
329322
330323
## 四、 添加定时任务

_posts/2024-08-21-share-shellcrashadguardhome-mihomo-ruleset.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ dns:
303303

304304
注:
305305
- 1. 本 `dns` 配置中,仅国外域名 `proxy` 走 `fake-ip`,`fakeip-filter` 和 `cn` 走国内 DNS 解析,未知域名走国外 DNS 解析(有效解决了“心理 DNS 泄露问题”,详见《[搭载 mihomo 内核配置 DNS 不泄露教程-ruleset 方案](https://proxy-tutorials.dustinwin.us.kg/posts/dnsnoleaks-mihomo-ruleset/)》),且配置 `ecs` 提高了兼容性
306-
- 2. 推荐将 `ecs` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml`)
306+
- 2. 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
307307

308308
```yaml
309309
hosts: {miwifi.com: [192.168.31.1, 127.0.0.1]}
@@ -322,20 +322,13 @@ dns:
322322
- MATCH,real-ip
323323
respect-rules: true
324324
nameserver:
325-
# 推荐将 `ecs` 设置为当前网络的公网 IP 段
326-
- 'https://dns.google/dns-query#ecs=202.103.17.0/24'
327-
- 'https://dns11.quad9.net/dns-query#ecs=202.103.17.0/24'
325+
# 推荐将 `ecs` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
326+
- 'https://dns.google/dns-query#ecs=211.137.58.0/24'
327+
- 'https://dns11.quad9.net/dns-query#ecs=211.137.58.0/24'
328328
proxy-server-nameserver: [system]
329329
direct-nameserver: [system]
330330
```
331331
332-
**新增定时任务**
333-
连接 SSH 后执行命令 `vi $CRASHDIR/task/task.user`,按一下 Ins 键(Insert 键),粘贴如下内容:
334-
335-
```shell
336-
204#sed -i -E "s/(ecs=)[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/yamls/user.yaml >/dev/null 2>&1#更新ecs地址
337-
```
338-
339332
---
340333
341334
## 四、 添加定时任务

_posts/2024-08-22-dnsnoleaks-singboxr-ruleset.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
5454
### 1. DNS 模式为 `mix`(推荐)
5555
- ① 连接 SSH 后执行命令 `vi $CRASHDIR/jsons/dns.json`,按一下 Ins 键(Insert 键),修改为如下内容:
5656

57-
>推荐将 `client_subnet` 设置为当前网络的公网 IP 段,如当前网络公网 IP`202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(\"client_subnet\": \")[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/jsons/dns.json`
57+
>推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS`211.137.58.20`,可设置为 `211.137.58.0/24`
5858
{: .prompt-info }
5959

6060
```json
@@ -77,8 +77,8 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
7777
"strategy": "prefer_ipv4",
7878
"independent_cache": true,
7979
"reverse_mapping": true,
80-
// 推荐将 `client_subnet` 设置为当前网络的公网 IP 段
81-
"client_subnet": "202.103.17.0/24"
80+
// 推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
81+
"client_subnet": "211.137.58.0/24"
8282
}
8383
}
8484
```
@@ -101,7 +101,7 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
101101
### 2. DNS 模式为 `fakeip`(不推荐)
102102
- ① 连接 SSH 后执行命令 `vi $CRASHDIR/jsons/dns.json`,按一下 Ins 键(Insert 键),修改为如下内容:
103103

104-
>推荐将 `client_subnet` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(\"client_subnet\": \")[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/jsons/dns.json`)
104+
>推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
105105
{: .prompt-info }
106106

107107
```json
@@ -123,8 +123,8 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
123123
"strategy": "prefer_ipv4",
124124
"independent_cache": true,
125125
"reverse_mapping": true,
126-
// 推荐将 `client_subnet` 设置为当前网络的公网 IP 段
127-
"client_subnet": "202.103.17.0/24"
126+
// 推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
127+
"client_subnet": "211.137.58.0/24"
128128
}
129129
}
130130
```
@@ -147,7 +147,7 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
147147
### 3. DNS 模式为 `redirhost`
148148
- ① 连接 SSH 后执行命令 `vi $CRASHDIR/jsons/dns.json`,按一下 Ins 键(Insert 键),修改为如下内容:
149149

150-
>推荐将 `client_subnet` 设置为当前网络的公网 IP 段,如当前网络公网 IP 为 `202.103.17.123`,可设置为 `202.103.17.0/24`(后续维护更新可直接执行命令 `sed -i -E "s/(\"client_subnet\": \")[0-9.]+\/[0-9]+/\1$(curl -s 4.ipw.cn | cut -d. -f1-3).0\/24/" $CRASHDIR/jsons/dns.json`)
150+
>推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`
151151
{: .prompt-info }
152152

153153
```json
@@ -169,8 +169,8 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
169169
"strategy": "prefer_ipv4",
170170
"independent_cache": true,
171171
"reverse_mapping": true,
172-
// 推荐将 `client_subnet` 设置为当前网络的公网 IP 段
173-
"client_subnet": "202.103.17.0/24"
172+
// 推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS 的 IP 段
173+
"client_subnet": "211.137.58.0/24"
174174
}
175175
}
176176
```

0 commit comments

Comments
 (0)