Skip to content

Commit 419dd6a

Browse files
committed
修改 hosts 配置以适配新版 sing-boxr 内核
1 parent cc68386 commit 419dd6a

8 files changed

Lines changed: 14 additions & 24 deletions

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@
2626
<img src="/assets/img/pin/wechat.png" alt="微信" width="30%" />
2727

2828
# 机场推荐
29-
[Bitz Net](https://dir3.bnaffloop.com/#/register?code=HT0ALWZq)(仅次于一线机场,推荐打折时购买)
30-
85 折优惠码:`XMAS2025`(有效期至 2026 年 1 月 2 日 23:59)
29+
[Bitz Net](https://red.bnaffred.com/#/register?code=HT0ALWZq)(仅次于一线机场,推荐打折时购买)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ tags: [sing-box, sing-boxr, Android, ruleset, rule_set, 分享]
6969
{ "tag": "dns_fakeip", "type": "fakeip", "inet4_range": "28.0.0.0/8", "inet6_range": "fc00::/16" }
7070
],
7171
"rules": [
72-
{ "action": "evaluate", "server": "hosts" },
73-
{ "match_response": true, "ip_accept_any": true, "action": "respond" },
72+
{ "preferred_by": [ "hosts" ], "server": "hosts" },
7473
{ "clash_mode": [ "Direct" ], "server": "dns_direct" },
7574
{ "clash_mode": [ "Global" ], "server": "dns_proxy" },
7675
{ "rule_set": [ "private" ], "server": "dns_local" },
@@ -85,7 +84,7 @@ tags: [sing-box, sing-boxr, Android, ruleset, rule_set, 分享]
8584
"optimistic": true,
8685
"reverse_mapping": true
8786
},
88-
"http_clients": [ { "tag": "detour_proxy", "version": 3, "detour": "GLOBAL" } ],
87+
"http_clients": [ { "tag": "detour_proxy", "detour": "GLOBAL" } ],
8988
"inbounds": [
9089
// 启动服务时如果出现 `tun-in` 报错,可新增 `"stack": "system"` 配置项
9190
{ "tag": "tun-in", "type": "tun", "interface_name": "sing-box", "address": [ "172.18.0.1/30", "fdfe:dcba:9876::1/126" ], "auto_route": true, "strict_route": true }
@@ -312,8 +311,7 @@ tags: [sing-box, sing-boxr, Android, ruleset, rule_set, 分享]
312311
{ "tag": "dns_fakeip", "type": "fakeip", "inet4_range": "28.0.0.0/8", "inet6_range": "fc00::/16" }
313312
],
314313
"rules": [
315-
{ "action": "evaluate", "server": "hosts" },
316-
{ "match_response": true, "ip_accept_any": true, "action": "respond" },
314+
{ "preferred_by": [ "hosts" ], "server": "hosts" },
317315
{ "clash_mode": [ "Direct" ], "server": "dns_direct" },
318316
{ "clash_mode": [ "Global" ], "server": "dns_proxy" },
319317
{ "rule_set": [ "private" ], "server": "dns_local" },

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 分
6060

6161
2. 连接 SSH 后执行如下命令:
6262
```shell
63-
sed -i ':a;N;$!ba;s/{[[:space:]]*"ip_accept_any": true,[[:space:]]*"server": "hosts"[[:space:]]*}/{ "action": "evaluate", "server": "hosts" },\
64-
{ "match_response": true, "ip_accept_any": true, "action": "respond" }/' "$CRASHDIR/starts/singbox_modify.sh"
63+
sed -i 's/"ip_accept_any": true,/"preferred_by": [ "hosts" ],/' "$CRASHDIR/starts/singbox_modify.sh"
6564
```
6665
3. 连接 SSH 后执行命令 `vi $CRASHDIR/jsons/dns.json`,按一下 Ins 键(Insert 键),粘贴如下内容:
6766
- 注:推荐将 `client_subnet` 设置为当前宽带运营商分配的默认 DNS(可进入光猫或路由器拨号页面查看,或者前往[公共 DNS 大全](https://toolb.cn/publicdns)查询)的 IP 段,如默认 DNS 为 `211.137.58.20`,可设置为 `211.137.58.0/24`

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ tags: [sing-box, sing-boxr, ShellCrash, ruleset, rule_set, 进阶, DNS, DNS 泄
5959

6060
2. 连接 SSH 后执行如下命令:
6161
```shell
62-
sed -i ':a;N;$!ba;s/{[[:space:]]*"ip_accept_any": true,[[:space:]]*"server": "hosts"[[:space:]]*}/{ "action": "evaluate", "server": "hosts" },\
63-
{ "match_response": true, "ip_accept_any": true, "action": "respond" }/' "$CRASHDIR/starts/singbox_modify.sh"
62+
sed -i 's/"ip_accept_any": true,/"preferred_by": [ "hosts" ],/' "$CRASHDIR/starts/singbox_modify.sh"
6463
```
6564

6665
## 三、 DNS 防泄漏配置

_posts/2024-08-22-share-shellcrash-singboxr-ruleset.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ sc
359359
连接 SSH 后执行命令 `vi $CRASHDIR/jsons/http_clients.json`,按一下 Ins 键(Insert 键),粘贴如下内容:
360360

361361
```json
362-
{ "http_clients": [ { "tag": "detour_proxy", "version": 3, "detour": "GLOBAL" } ] }
362+
{ "http_clients": [ { "tag": "detour_proxy", "detour": "GLOBAL" } ] }
363363
```
364364

365365
## 五、 编辑 experimental.json 文件
@@ -396,8 +396,7 @@ sc
396396

397397
3. 连接 SSH 后执行如下命令:
398398
```shell
399-
sed -i ':a;N;$!ba;s/{[[:space:]]*"ip_accept_any": true,[[:space:]]*"server": "hosts"[[:space:]]*}/{ "action": "evaluate", "server": "hosts" },\
400-
{ "match_response": true, "ip_accept_any": true, "action": "respond" }/' "$CRASHDIR/starts/singbox_modify.sh"
399+
sed -i 's/"ip_accept_any": true,/"preferred_by": [ "hosts" ],/' "$CRASHDIR/starts/singbox_modify.sh"
401400
sed -i '/#生成experimental.json/i\
402401
#生成http_clients.json\
403402
cat >"$TMPDIR"/jsons/http_clients.json <<EOF\

_posts/2024-08-22-share-shellcrashadguardhome-singboxr-ruleset.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ sc
364364
连接 SSH 后执行命令 `vi $CRASHDIR/jsons/http_clients.json`,按一下 Ins 键(Insert 键),粘贴如下内容:
365365

366366
```json
367-
{ "http_clients": [ { "tag": "detour_proxy", "version": 3, "detour": "GLOBAL" } ] }
367+
{ "http_clients": [ { "tag": "detour_proxy", "detour": "GLOBAL" } ] }
368368
```
369369

370370
## 五、 编辑 experimental.json 文件
@@ -406,8 +406,7 @@ sc
406406

407407
4. 连接 SSH 后执行如下命令:
408408
```shell
409-
sed -i ':a;N;$!ba;s/{[[:space:]]*"ip_accept_any": true,[[:space:]]*"server": "hosts"[[:space:]]*}/{ "action": "evaluate", "server": "hosts" },\
410-
{ "match_response": true, "ip_accept_any": true, "action": "respond" }/' "$CRASHDIR/starts/singbox_modify.sh"
409+
sed -i 's/"ip_accept_any": true,/"preferred_by": [ "hosts" ],/' "$CRASHDIR/starts/singbox_modify.sh"
411410
sed -i '/#生成experimental.json/i\
412411
#生成http_clients.json\
413412
cat >"$TMPDIR"/jsons/http_clients.json <<EOF\

_posts/2024-08-22-share-windows-singboxr-ruleset.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ tags: [sing-box, sing-boxr, Windows, ruleset, rule_set, 分享]
7070
{ "tag": "dns_fakeip", "type": "fakeip", "inet4_range": "28.0.0.0/8", "inet6_range": "fc00::/16" }
7171
],
7272
"rules": [
73-
{ "action": "evaluate", "server": "hosts" },
74-
{ "match_response": true, "ip_accept_any": true, "action": "respond" },
73+
{ "preferred_by": [ "hosts" ], "server": "hosts" },
7574
{ "clash_mode": [ "Direct" ], "server": "dns_direct" },
7675
{ "clash_mode": [ "Global" ], "server": "dns_proxy" },
7776
{ "rule_set": [ "private" ], "server": "dns_local" },
@@ -86,7 +85,7 @@ tags: [sing-box, sing-boxr, Windows, ruleset, rule_set, 分享]
8685
"optimistic": true,
8786
"reverse_mapping": true
8887
},
89-
"http_clients": [ { "tag": "detour_proxy", "version": 3, "detour": "GLOBAL" } ],
88+
"http_clients": [ { "tag": "detour_proxy", "detour": "GLOBAL" } ],
9089
"inbounds": [
9190
{ "tag": "tun-in", "type": "tun", "interface_name": "sing-box", "address": [ "172.18.0.1/30", "fdfe:dcba:9876::1/126" ], "auto_route": true, "strict_route": true }
9291
],
@@ -310,8 +309,7 @@ tags: [sing-box, sing-boxr, Windows, ruleset, rule_set, 分享]
310309
{ "tag": "dns_fakeip", "type": "fakeip", "inet4_range": "28.0.0.0/8", "inet6_range": "fc00::/16" }
311310
],
312311
"rules": [
313-
{ "action": "evaluate", "server": "hosts" },
314-
{ "match_response": true, "ip_accept_any": true, "action": "respond" },
312+
{ "preferred_by": [ "hosts" ], "server": "hosts" },
315313
{ "clash_mode": [ "Direct" ], "server": "dns_direct" },
316314
{ "clash_mode": [ "Global" ], "server": "dns_proxy" },
317315
{ "rule_set": [ "private" ], "server": "dns_local" },

_posts/2025-04-26-pin-tips_support.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ pin: true
1212
<img src="/assets/img/pin/wechat.png" alt="微信" width="30%" />
1313

1414
# 机场推荐
15-
[Bitz Net](https://dir3.bnaffloop.com/#/register?code=HT0ALWZq)(仅次于一线机场,推荐打折时购买)
16-
85 折优惠码:`XMAS2025`(有效期至 2026 年 1 月 2 日 23:59)
15+
[Bitz Net](https://red.bnaffred.com/#/register?code=HT0ALWZq)(仅次于一线机场,推荐打折时购买)

0 commit comments

Comments
 (0)