documentation: Fixes

This commit is contained in:
世界
2026-04-10 11:34:39 +08:00
parent c61e5820a5
commit 79ba7e59a9
12 changed files with 320 additions and 222 deletions
+1 -1
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. `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`. One of `prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`.
+1 -1
View File
@@ -44,7 +44,7 @@ icon: material/new-box
`strategy` 已在 sing-box 1.14.0 废弃,且将在 sing-box 1.16.0 中被移除。 `strategy` 已在 sing-box 1.14.0 废弃,且将在 sing-box 1.16.0 中被移除。
为此查询设置域名策略。已废弃,参阅[迁移指南](/zh/migration/#迁移-dns-规则动作-strategy-到规则项)。 为此查询设置域名策略。
可选项:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only` 可选项:`prefer_ipv4` `prefer_ipv6` `ipv4_only` `ipv6_only`
+50 -19
View File
@@ -73,24 +73,55 @@ Example:
=== "Use hosts if available" === "Use hosts if available"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
... "servers": [
}, {
{ ...
"type": "hosts", },
"tag": "hosts" {
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"action": "evaluate",
"server": "hosts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "hosts"
```json
{
"dns": {
"servers": [
{
...
},
{
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "hosts"
}
]
} }
] }
} ```
}
```
+50 -19
View File
@@ -73,24 +73,55 @@ hosts 文件路径列表。
=== "如果可用则使用 hosts" === "如果可用则使用 hosts"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
... "servers": [
}, {
{ ...
"type": "hosts", },
"tag": "hosts" {
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"action": "evaluate",
"server": "hosts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "hosts"
```json
{
"dns": {
"servers": [
{
...
},
{
"type": "hosts",
"tag": "hosts"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "hosts"
}
]
} }
] }
} ```
}
```
+54 -21
View File
@@ -43,29 +43,62 @@ If not enabled, `NXDOMAIN` will be returned for requests that do not match searc
=== "Split DNS only" === "Split DNS only"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
"type": "local", "servers": [
"tag": "local" {
}, "type": "local",
{ "tag": "local"
"type": "resolved", },
"tag": "resolved", {
"service": "resolved" "type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"action": "evaluate",
"server": "resolved"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "resolved"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "resolved"
}
]
} }
] }
} ```
}
```
=== "Use as global DNS" === "Use as global DNS"
+54 -21
View File
@@ -42,29 +42,62 @@ icon: material/new-box
=== "仅分割 DNS" === "仅分割 DNS"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
"type": "local", "servers": [
"tag": "local" {
}, "type": "local",
{ "tag": "local"
"type": "resolved", },
"tag": "resolved", {
"service": "resolved" "type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"action": "evaluate",
"server": "resolved"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "resolved"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "resolved",
"tag": "resolved",
"service": "resolved"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "resolved"
}
]
} }
] }
} ```
}
```
=== "用作全局 DNS" === "用作全局 DNS"
+54 -21
View File
@@ -42,29 +42,62 @@ if not enabled, `NXDOMAIN` will be returned for non-Tailscale domain queries.
=== "MagicDNS only" === "MagicDNS only"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
"type": "local", "servers": [
"tag": "local" {
}, "type": "local",
{ "tag": "local"
"type": "tailscale", },
"tag": "ts", {
"endpoint": "ts-ep" "type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"action": "evaluate",
"server": "ts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "ts"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "ts"
}
]
} }
] }
} ```
}
```
=== "Use as global DNS" === "Use as global DNS"
+54 -21
View File
@@ -42,29 +42,62 @@ icon: material/new-box
=== "仅 MagicDNS" === "仅 MagicDNS"
```json === ":material-card-multiple: sing-box 1.14.0"
{
"dns": { ```json
"servers": [ {
{ "dns": {
"type": "local", "servers": [
"tag": "local" {
}, "type": "local",
{ "tag": "local"
"type": "tailscale", },
"tag": "ts", {
"endpoint": "ts-ep" "type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"action": "evaluate",
"server": "ts"
},
{
"match_response": true,
"ip_accept_any": true,
"action": "respond"
}
]
} }
], }
"rules": [ ```
{
"ip_accept_any": true, === ":material-card-remove: sing-box < 1.14.0"
"server": "ts"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "ts"
}
]
} }
] }
} ```
}
```
=== "用作全局 DNS" === "用作全局 DNS"
+1 -2
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
Legacy `strategy` DNS rule action option is deprecated, Legacy `strategy` DNS rule action option is deprecated.
check [Migration](../migration/#migrate-dns-rule-action-strategy-to-rule-items).
Old fields will be removed in sing-box 1.16.0. Old fields will be removed in sing-box 1.16.0.
+1 -2
View File
@@ -16,8 +16,7 @@ TLS 中的内联 ACME 选项(`tls.acme`)已废弃,
#### 旧版 DNS 规则动作 `strategy` 选项 #### 旧版 DNS 规则动作 `strategy` 选项
旧版 DNS 规则动作 `strategy` 选项已废弃 旧版 DNS 规则动作 `strategy` 选项已废弃
参阅[迁移指南](/zh/migration/#迁移-dns-规则动作-strategy-到规则项)。
旧字段将在 sing-box 1.16.0 中被移除。 旧字段将在 sing-box 1.16.0 中被移除。
-47
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 ### Migrate address filter fields to response matching
Legacy Address Filter Fields (`ip_cidr`, `ip_is_private` without `match_response`) in DNS rules are deprecated, Legacy Address Filter Fields (`ip_cidr`, `ip_is_private` without `match_response`) in DNS rules are deprecated,
-47
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`)已废弃, 旧版地址筛选字段(不使用 `match_response` 的 `ip_cidr`、`ip_is_private`)已废弃,