documentation: Fixes

This commit is contained in:
世界
2026-04-10 11:34:39 +08:00
parent ddcaf040e2
commit e0696f5e94
12 changed files with 320 additions and 222 deletions

View File

@@ -44,7 +44,7 @@ Tag of target server.
`strategy` is deprecated in sing-box 1.14.0 and will be removed in sing-box 1.16.0.
Set domain strategy for this query. Deprecated, check [Migration](/migration/#migrate-dns-rule-action-strategy-to-rule-items).
Set domain strategy for this query.
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.

View File

@@ -44,7 +44,7 @@ icon: material/new-box
`strategy` 已在 sing-box 1.14.0 废弃,且将在 sing-box 1.16.0 中被移除。
为此查询设置域名策略。已废弃,参阅[迁移指南](/zh/migration/#迁移-dns-规则动作-strategy-到规则项)。
为此查询设置域名策略。
可选项:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`

View File

@@ -73,6 +73,37 @@ Example:
=== "Use hosts if available"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
...
},
{
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"action": "evaluate",
"server": "hosts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -73,6 +73,37 @@ hosts 文件路径列表。
=== "如果可用则使用 hosts"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
...
},
{
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"action": "evaluate",
"server": "hosts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -43,6 +43,39 @@ If not enabled, `NXDOMAIN` will be returned for requests that do not match searc
=== "Split DNS only"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"action": "evaluate",
"server": "resolved"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -42,6 +42,39 @@ icon: material/new-box
=== "仅分割 DNS"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"action": "evaluate",
"server": "resolved"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -42,6 +42,39 @@ if not enabled, `NXDOMAIN` will be returned for non-Tailscale domain queries.
=== "MagicDNS only"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"action": "evaluate",
"server": "ts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -42,6 +42,39 @@ icon: material/new-box
=== "仅 MagicDNS"
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"action": "evaluate",
"server": "ts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
}
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {

View File

@@ -16,8 +16,7 @@ Old fields will be removed in sing-box 1.16.0.
#### Legacy `strategy` DNS rule action option
Legacy `strategy` DNS rule action option is deprecated,
check [Migration](../migration/#migrate-dns-rule-action-strategy-to-rule-items).
Legacy `strategy` DNS rule action option is deprecated.
Old fields will be removed in sing-box 1.16.0.

View File

@@ -16,8 +16,7 @@ TLS 中的内联 ACME 选项(`tls.acme`)已废弃,
#### 旧版 DNS 规则动作 `strategy` 选项
旧版 DNS 规则动作 `strategy` 选项已废弃
参阅[迁移指南](/zh/migration/#迁移-dns-规则动作-strategy-到规则项)。
旧版 DNS 规则动作 `strategy` 选项已废弃
旧字段将在 sing-box 1.16.0 中被移除。

View File

@@ -79,53 +79,6 @@ See [ACME](/configuration/shared/certificate-provider/acme/) for fields newly ad
}
```
### Migrate DNS rule action strategy to rule items
Legacy `strategy` DNS rule action option is deprecated.
In sing-box 1.14.0, internal domain resolution (Lookup) now splits A and AAAA queries
at the rule level, so each query type is evaluated independently through the full rule chain.
Use `ip_version` or `query_type` rule items to control which query types a rule matches.
!!! info "References"
[DNS Rule](/configuration/dns/rule/) /
[DNS Rule Action](/configuration/dns/rule_action/)
=== ":material-card-remove: Deprecated"
```json
{
"dns": {
"rules": [
{
"domain_suffix": ".cn",
"action": "route",
"server": "local",
"strategy": "ipv4_only"
}
]
}
}
```
=== ":material-card-multiple: New"
```json
{
"dns": {
"rules": [
{
"domain_suffix": ".cn",
"ip_version": 4,
"action": "route",
"server": "local"
}
]
}
}
```
### Migrate address filter fields to response matching
Legacy Address Filter Fields (`ip_cidr`, `ip_is_private` without `match_response`) in DNS rules are deprecated,

View File

@@ -79,53 +79,6 @@ sing-box 1.14.0 新增字段参阅 [ACME](/zh/configuration/shared/certificate-p
}
```
### 迁移 DNS 规则动作 strategy 到规则项
旧版 DNS 规则动作 `strategy` 选项已废弃。
在 sing-box 1.14.0 中内部域名解析Lookup现在在规则层拆分 A 和 AAAA 查询,
每种查询类型独立通过完整的规则链评估。
请使用 `ip_version` 或 `query_type` 规则项来控制规则匹配的查询类型。
!!! info "参考"
[DNS 规则](/zh/configuration/dns/rule/) /
[DNS 规则动作](/zh/configuration/dns/rule_action/)
=== ":material-card-remove: 弃用的"
```json
{
"dns": {
"rules": [
{
"domain_suffix": ".cn",
"action": "route",
"server": "local",
"strategy": "ipv4_only"
}
]
}
}
```
=== ":material-card-multiple: 新的"
```json
{
"dns": {
"rules": [
{
"domain_suffix": ".cn",
"ip_version": 4,
"action": "route",
"server": "local"
}
]
}
}
```
### 迁移地址筛选字段到响应匹配
旧版地址筛选字段(不使用 `match_response` 的 `ip_cidr`、`ip_is_private`)已废弃,