mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 04:38:28 +10:00
Fix missing handling of legacy domain_strategy options
This commit is contained in:
@@ -206,7 +206,7 @@ Only take effect when `domain_strategy` or `network_strategy` is set.
|
||||
|
||||
!!! failure "Deprecated in sing-box 1.12.0"
|
||||
|
||||
`domain_strategy` is merged to [domain_resolver](#domain_resolver) in sing-box 1.12.0.
|
||||
`domain_strategy` is deprecated and will be removed in sing-box 1.14.0, check [Migration](/migration/#migrate-outbound-domain-strategy-option-to-domain-resolver).
|
||||
|
||||
Available values: `prefer_ipv4`, `prefer_ipv6`, `ipv4_only`, `ipv6_only`.
|
||||
|
||||
|
||||
@@ -194,6 +194,10 @@ icon: material/new-box
|
||||
|
||||
#### domain_strategy
|
||||
|
||||
!!! failure "已在 sing-box 1.12.0 废弃"
|
||||
|
||||
`domain_strategy` 已废弃且将在 sing-box 1.14.0 中被移除,参阅 [迁移指南](/migration/#migrate-outbound-domain-strategy-option-to-domain-resolver)。
|
||||
|
||||
可选值:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`。
|
||||
|
||||
如果设置,域名将在请求发出之前解析为 IP。
|
||||
|
||||
@@ -516,13 +516,13 @@ DNS servers are refactored for better performance and scalability.
|
||||
The legacy outbound DNS rules are deprecated and can be replaced by new domain resolver options.
|
||||
|
||||
!!! info "References"
|
||||
|
||||
|
||||
[DNS rule](/configuration/dns/rule/#outbound) /
|
||||
[Dial Fields](/configuration/shared/dial/#domain_resolver) /
|
||||
[Route](/configuration/route/#domain_resolver)
|
||||
|
||||
=== ":material-card-remove: Deprecated"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -586,6 +586,57 @@ The legacy outbound DNS rules are deprecated and can be replaced by new domain r
|
||||
}
|
||||
```
|
||||
|
||||
### Migrate outbound domain strategy option to domain resolver
|
||||
|
||||
!!! info "References"
|
||||
|
||||
[Dial Fields](/configuration/shared/dial/#domain_strategy)
|
||||
|
||||
The `domain_strategy` option in Dial Fields has been deprecated and can be replaced with the new domain resolver option.
|
||||
|
||||
Note that due to the use of Dial Fields by some of the new DNS servers introduced in sing-box 1.12,
|
||||
some people mistakenly believe that `domain_strategy` is the same feature as in the legacy DNS servers.
|
||||
|
||||
=== ":material-card-remove: Deprecated"
|
||||
|
||||
```json
|
||||
{
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "socks",
|
||||
"server": "example.org",
|
||||
"server_port": 2080,
|
||||
"domain_strategy": "prefer_ipv4",
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
=== ":material-card-multiple: New"
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"type": "local"
|
||||
}
|
||||
]
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "socks",
|
||||
"server": "example.org",
|
||||
"server_port": 2080,
|
||||
"domain_resolver": {
|
||||
"server": "local",
|
||||
"strategy": "prefer_ipv4"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 1.11.0
|
||||
|
||||
### Migrate legacy special outbounds to rule actions
|
||||
|
||||
@@ -16,7 +16,7 @@ DNS 服务器已经重构。
|
||||
=== "Local"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -28,9 +28,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -46,7 +46,7 @@ DNS 服务器已经重构。
|
||||
=== "TCP"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -58,9 +58,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -77,7 +77,7 @@ DNS 服务器已经重构。
|
||||
=== "UDP"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -89,9 +89,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -108,7 +108,7 @@ DNS 服务器已经重构。
|
||||
=== "TLS"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -120,9 +120,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -139,7 +139,7 @@ DNS 服务器已经重构。
|
||||
=== "HTTPS"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -151,9 +151,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -170,7 +170,7 @@ DNS 服务器已经重构。
|
||||
=== "QUIC"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -182,9 +182,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -201,7 +201,7 @@ DNS 服务器已经重构。
|
||||
=== "HTTP3"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -213,9 +213,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -232,7 +232,7 @@ DNS 服务器已经重构。
|
||||
=== "DHCP"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -247,9 +247,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -269,7 +269,7 @@ DNS 服务器已经重构。
|
||||
=== "FakeIP"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -299,9 +299,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -333,7 +333,7 @@ DNS 服务器已经重构。
|
||||
=== "RCode"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -345,9 +345,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -368,7 +368,7 @@ DNS 服务器已经重构。
|
||||
=== "带有域名地址的服务器"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -385,9 +385,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -410,7 +410,7 @@ DNS 服务器已经重构。
|
||||
=== "带有域策略的服务器"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -434,9 +434,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -466,7 +466,7 @@ DNS 服务器已经重构。
|
||||
=== "带有客户端子网的服务器"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -483,9 +483,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
@@ -586,6 +586,56 @@ DNS 服务器已经重构。
|
||||
}
|
||||
```
|
||||
|
||||
### 迁移出站域名策略选项到域名解析器
|
||||
|
||||
拨号字段中的 `domain_strategy` 选项已被弃用,可以用新的域名解析器选项替代。
|
||||
|
||||
请注意,由于 sing-box 1.12 中引入的一些新 DNS 服务器使用了拨号字段,一些人错误地认为 `domain_strategy` 与旧 DNS 服务器中的功能相同。
|
||||
|
||||
!!! info "参考"
|
||||
|
||||
[拨号字段](/configuration/shared/dial/#domain_strategy)
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
```json
|
||||
{
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "socks",
|
||||
"server": "example.org",
|
||||
"server_port": 2080,
|
||||
"domain_strategy": "prefer_ipv4",
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"type": "local"
|
||||
}
|
||||
]
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "socks",
|
||||
"server": "example.org",
|
||||
"server_port": 2080,
|
||||
"domain_resolver": {
|
||||
"server": "local",
|
||||
"strategy": "prefer_ipv4"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 1.11.0
|
||||
|
||||
### 迁移旧的特殊出站到规则动作
|
||||
@@ -601,7 +651,7 @@ DNS 服务器已经重构。
|
||||
=== "Block"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"outbounds": [
|
||||
@@ -614,7 +664,7 @@ DNS 服务器已经重构。
|
||||
"rules": [
|
||||
{
|
||||
...,
|
||||
|
||||
|
||||
"outbound": "block"
|
||||
}
|
||||
]
|
||||
@@ -623,14 +673,14 @@ DNS 服务器已经重构。
|
||||
```
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"route": {
|
||||
"rules": [
|
||||
{
|
||||
...,
|
||||
|
||||
|
||||
"action": "reject"
|
||||
}
|
||||
]
|
||||
@@ -641,13 +691,13 @@ DNS 服务器已经重构。
|
||||
=== "DNS"
|
||||
|
||||
=== ":material-card-remove: 弃用的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"inbound": [
|
||||
{
|
||||
...,
|
||||
|
||||
|
||||
"sniff": true
|
||||
}
|
||||
],
|
||||
@@ -667,9 +717,9 @@ DNS 服务器已经重构。
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
=== ":material-card-multiple: 新的"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"route": {
|
||||
@@ -1133,4 +1183,4 @@ sing-box 1.9.0 使 QueryFullProcessImageNameW 输出 Win32 路径(如 `C:\fold
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user