docs: fix strategy deprecation format, explain legacyDNSMode, unify CN/EN order

- Use standard !!! failure block for strategy deprecation notice
- Add Legacy DNS Mode section explaining automatic mode detection
- Reorder ip_accept_any/rule_set_ip_cidr_accept_empty in Chinese docs
  to match English
This commit is contained in:
世界
2026-03-31 15:43:04 +08:00
parent 19b2e48f6e
commit 1897e512ac
4 changed files with 34 additions and 17 deletions

View File

@@ -544,6 +544,15 @@ See [DNS Rule Actions](../rule_action/) for details.
Moved to [DNS Rule Action](../rule_action#route).
### Legacy DNS Mode
`legacyDNSMode` is an internal compatibility mode that is automatically detected from your DNS rule
configuration. It is disabled when any rule uses features introduced in sing-box 1.14.0 such as
`evaluate`, `match_response`, response fields (`response_rcode`, `response_answer`, etc.),
`query_type`, or `ip_version`. When disabled, `ip_cidr` and `ip_is_private` require `match_response`
to be set, and deprecated fields like `strategy`, `ip_accept_any`, and `rule_set_ip_cidr_accept_empty`
are no longer accepted.
### Address Filter Fields
Only takes effect for address requests (A/AAAA/HTTPS). When the query results do not match the address filtering rule items, the current rule will be skipped.

View File

@@ -542,6 +542,14 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
已移动到 [DNS 规则动作](../rule_action#route).
### Legacy DNS Mode
`legacyDNSMode` 是一种内部兼容模式,会根据 DNS 规则配置自动检测。
当任何规则使用了 sing-box 1.14.0 引入的特性(如 `evaluate``match_response`
响应字段(`response_rcode``response_answer` 等)、`query_type``ip_version`)时,
该模式将被自动禁用。禁用后,`ip_cidr``ip_is_private` 需要设置 `match_response`
且已废弃的字段(如 `strategy``ip_accept_any``rule_set_ip_cidr_accept_empty`)将不再被接受。
### 地址筛选字段
仅对地址请求 (A/AAAA/HTTPS) 生效。 当查询结果与地址筛选规则项不匹配时,将跳过当前规则。
@@ -579,17 +587,6 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
`legacyDNSMode` 未启用时,`match_response` 必须设为 `true`
#### ip_accept_any
!!! question "自 sing-box 1.12.0 起"
!!! failure "已在 sing-box 1.14.0 废弃"
`ip_accept_any` 已废弃且将在 sing-box 1.16.0 中被移除。
仅在 `legacyDNSMode` 中可用。请使用 `match_response` 和响应项替代。
匹配任意 IP。
#### rule_set_ip_cidr_accept_empty
!!! question "自 sing-box 1.10.0 起"
@@ -601,6 +598,17 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
使规则集中的 `ip_cidr` 规则接受空查询响应。
#### ip_accept_any
!!! question "自 sing-box 1.12.0 起"
!!! failure "已在 sing-box 1.14.0 废弃"
`ip_accept_any` 已废弃且将在 sing-box 1.16.0 中被移除。
仅在 `legacyDNSMode` 中可用。请使用 `match_response` 和响应项替代。
匹配任意 IP。
### 响应字段
!!! question "自 sing-box 1.14.0 起"

View File

@@ -39,11 +39,11 @@ Tag of target server.
!!! question "Since sing-box 1.12.0"
!!! warning
!!! failure "Deprecated in sing-box 1.14.0"
`strategy` is deprecated and only supported in `legacyDNSMode`.
`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 in `legacyDNSMode`.
Set domain strategy for this query. Only supported when `legacyDNSMode` is active.
One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.

View File

@@ -39,11 +39,11 @@ icon: material/new-box
!!! question "自 sing-box 1.12.0 起"
!!! warning
!!! failure "已在 sing-box 1.14.0 废弃"
`strategy` 已废弃,且`legacyDNSMode` 中可用
`strategy`在 sing-box 1.14.0 废弃,且sing-box 1.16.0 中被移除
`legacyDNSMode` 中为此查询设置域名策略
为此查询设置域名策略。仅`legacyDNSMode` 启用时可用
可选项:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`