Commit f24a2ae 1 parent 0517cee commit f24a2ae Copy full SHA for f24a2ae
File tree 18 files changed +313
-137
lines changed
18 files changed +313
-137
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ type DNSRule interface {
86
86
Rule
87
87
DisableCache () bool
88
88
RewriteTTL () * uint32
89
+ ClientSubnet () * netip.Addr
89
90
WithAddressLimit () bool
90
91
MatchAddressLimit (metadata * InboundContext ) bool
91
92
}
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! quote "Changes in sing-box 1.9.0"
6
+
7
+ :material-plus: [client_subnet](#client_subnet)
8
+
1
9
# DNS
2
10
3
11
### Structure
13
21
"disable_expire" : false ,
14
22
"independent_cache" : false ,
15
23
"reverse_mapping" : false ,
24
+ "client_subnet" : " " ,
16
25
"fakeip" : {}
17
26
}
18
27
}
@@ -60,6 +69,10 @@ Stores a reverse mapping of IP addresses after responding to a DNS query in orde
60
69
Since this process relies on the act of resolving domain names by an application before making a request, it can be
61
70
problematic in environments such as macOS, where DNS is proxied and cached by the system.
62
71
63
- #### fakeip
72
+ #### client_subnet
73
+
74
+ !!! question "Since sing-box 1.9.0"
75
+
76
+ Append a ` edns0-subnet ` OPT extra record with the specified IP address to every query by default.
64
77
65
- [ FakeIP ] ( ./fakeip/ ) settings .
78
+ Can be overrides by ` servers.[].client_subnet ` or ` rules.[].client_subnet ` .
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! quote "sing-box 1.9.0 中的更改"
6
+
7
+ :material-plus: [client_subnet](#client_subnet)
8
+
1
9
# DNS
2
10
3
11
### 结构
13
21
"disable_expire" : false ,
14
22
"independent_cache" : false ,
15
23
"reverse_mapping" : false ,
24
+ "client_subnet" : " " ,
16
25
"fakeip" : {}
17
26
}
18
27
}
58
67
59
68
由于此过程依赖于应用程序在发出请求之前解析域名的行为,因此在 macOS 等 DNS 由系统代理和缓存的环境中可能会出现问题。
60
69
70
+ #### client_subnet
71
+
72
+ !!! question "自 sing-box 1.9.0 起"
73
+
74
+ 默认情况下,将带有指定 IP 地址的 ` edns0-subnet ` OPT 附加记录附加到每个查询。
75
+
76
+ 可以被 ` servers.[].client_subnet ` 或 ` rules.[].client_subnet ` 覆盖。
77
+
61
78
#### fakeip
62
79
63
80
[ FakeIP] ( ./fakeip/ ) 设置。
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ icon: material/new-box
6
6
7
7
:material-plus: [geoip](#geoip)
8
8
:material-plus: [ip_cidr](#ip_cidr)
9
- :material-plus: [ip_is_private](#ip_is_private)
9
+ :material-plus: [ip_is_private](#ip_is_private)
10
+ :material-plus: [client_subnet](#client_subnet)
10
11
11
12
!!! quote "Changes in sing-box 1.8.0"
12
13
@@ -121,15 +122,17 @@ icon: material/new-box
121
122
],
122
123
"server" : " local" ,
123
124
"disable_cache" : false ,
124
- "rewrite_ttl" : 100
125
+ "rewrite_ttl" : 100 ,
126
+ "client_subnet" : " 127.0.0.1"
125
127
},
126
128
{
127
129
"type" : " logical" ,
128
130
"mode" : " and" ,
129
131
"rules" : [],
130
132
"server" : " local" ,
131
133
"disable_cache" : false ,
132
- "rewrite_ttl" : 100
134
+ "rewrite_ttl" : 100 ,
135
+ "client_subnet" : " 127.0.0.1"
133
136
}
134
137
]
135
138
}
@@ -280,8 +283,6 @@ Match Clash mode.
280
283
281
284
#### wifi_ssid
282
285
283
- <!-- md:version 1.7.0-beta.4 -->
284
-
285
286
!!! quote ""
286
287
287
288
Only supported in graphical clients on Android and iOS.
@@ -326,6 +327,14 @@ Disable cache and save cache in this query.
326
327
327
328
Rewrite TTL in DNS responses.
328
329
330
+ #### client_subnet
331
+
332
+ !!! question "Since sing-box 1.9.0"
333
+
334
+ Append a ` edns0-subnet ` OPT extra record with the specified IP address to every query by default.
335
+
336
+ Will overrides ` dns.client_subnet ` and ` servers.[].client_subnet ` .
337
+
329
338
### Address Filter Fields
330
339
331
340
Only takes effect for IP address requests. When the query results do not match the address filtering rule items, the current rule will be skipped.
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ icon: material/new-box
6
6
7
7
:material-plus: [geoip](#geoip)
8
8
:material-plus: [ip_cidr](#ip_cidr)
9
- :material-plus: [ip_is_private](#ip_is_private)
9
+ :material-plus: [ip_is_private](#ip_is_private)
10
+ :material-plus: [client_subnet](#client_subnet)
10
11
11
12
!!! quote "sing-box 1.8.0 中的更改"
12
13
@@ -120,14 +121,16 @@ icon: material/new-box
120
121
" direct"
121
122
],
122
123
"server" : " local" ,
123
- "disable_cache" : false
124
+ "disable_cache" : false ,
125
+ "client_subnet" : " 127.0.0.1"
124
126
},
125
127
{
126
128
"type" : " logical" ,
127
129
"mode" : " and" ,
128
130
"rules" : [],
129
131
"server" : " local" ,
130
- "disable_cache" : false
132
+ "disable_cache" : false ,
133
+ "client_subnet" : " 127.0.0.1"
131
134
}
132
135
]
133
136
}
@@ -322,6 +325,14 @@ DNS 查询类型。值可以为整数或者类型名称字符串。
322
325
323
326
重写 DNS 回应中的 TTL。
324
327
328
+ #### client_subnet
329
+
330
+ !!! question "自 sing-box 1.9.0 起"
331
+
332
+ 默认情况下,将带有指定 IP 地址的 ` edns0-subnet ` OPT 附加记录附加到每个查询。
333
+
334
+ 将覆盖 ` dns.client_subnet ` 与 ` servers.[].client_subnet ` 。
335
+
325
336
### 地址筛选字段
326
337
327
338
仅对IP地址请求生效。 当查询结果与地址筛选规则项不匹配时,将跳过当前规则。
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! quote "Changes in sing-box 1.9.0"
6
+
7
+ :material-plus: [client_subnet](#client_subnet)
8
+
1
9
### Structure
2
10
3
11
``` json
4
12
{
5
13
"dns" : {
6
14
"servers" : [
7
15
{
8
- "tag" : " google" ,
9
- "address" : " tls://dns.google" ,
10
- "address_resolver" : " local" ,
11
- "address_strategy" : " prefer_ipv4" ,
12
- "strategy" : " ipv4_only" ,
13
- "detour" : " direct"
16
+ "tag" : " " ,
17
+ "address" : " " ,
18
+ "address_resolver" : " " ,
19
+ "address_strategy" : " " ,
20
+ "strategy" : " " ,
21
+ "detour" : " " ,
22
+ "client_subnet" : " "
14
23
}
15
24
]
16
25
}
17
26
}
18
-
19
27
```
20
28
21
29
### Fields
@@ -80,10 +88,20 @@ Default domain strategy for resolving the domain names.
80
88
81
89
One of ` prefer_ipv4 ` ` prefer_ipv6 ` ` ipv4_only ` ` ipv6_only ` .
82
90
83
- Take no effect if override by other settings.
91
+ Take no effect if overridden by other settings.
84
92
85
93
#### detour
86
94
87
95
Tag of an outbound for connecting to the dns server.
88
96
89
97
Default outbound will be used if empty.
98
+
99
+ #### client_subnet
100
+
101
+ !!! question "Since sing-box 1.9.0"
102
+
103
+ Append a ` edns0-subnet ` OPT extra record with the specified IP address to every query by default.
104
+
105
+ Can be overrides by ` rules.[].client_subnet ` .
106
+
107
+ Will overrides ` dns.client_subnet ` .
Original file line number Diff line number Diff line change
1
+ ---
2
+ icon : material/new-box
3
+ ---
4
+
5
+ !!! quote "sing-box 1.9.0 中的更改"
6
+
7
+ :material-plus: [client_subnet](#client_subnet)
8
+
1
9
### 结构
2
10
3
11
``` json
4
12
{
5
13
"dns" : {
6
14
"servers" : [
7
15
{
8
- "tag" : " google" ,
9
- "address" : " tls://dns.google" ,
10
- "address_resolver" : " local" ,
11
- "address_strategy" : " prefer_ipv4" ,
12
- "strategy" : " ipv4_only" ,
13
- "detour" : " direct"
16
+ "tag" : " " ,
17
+ "address" : " " ,
18
+ "address_resolver" : " " ,
19
+ "address_strategy" : " " ,
20
+ "strategy" : " " ,
21
+ "detour" : " " ,
22
+ "client_subnet" : " "
14
23
}
15
24
]
16
25
}
17
26
}
18
-
19
27
```
20
28
21
29
### 字段
@@ -87,3 +95,13 @@ DNS 服务器的地址。
87
95
用于连接到 DNS 服务器的出站的标签。
88
96
89
97
如果为空,将使用默认出站。
98
+
99
+ #### client_subnet
100
+
101
+ !!! question "自 sing-box 1.9.0 起"
102
+
103
+ 默认情况下,将带有指定 IP 地址的 ` edns0-subnet ` OPT 附加记录附加到每个查询。
104
+
105
+ 可以被 ` rules.[].client_subnet ` 覆盖。
106
+
107
+ 将覆盖 ` dns.client_subnet ` 。
You can’t perform that action at this time.
0 commit comments