dns: Add preferred_by rule item

This commit is contained in:
世界 2026-04-29 22:48:02 +08:00
parent e171852b19
commit fdec2fe051
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
12 changed files with 208 additions and 4 deletions

View file

@ -6,6 +6,7 @@ icon: material/alert-decagram
:material-plus: [source_mac_address](#source_mac_address)
:material-plus: [source_hostname](#source_hostname)
:material-plus: [preferred_by](#preferred_by)
:material-plus: [match_response](#match_response)
:material-delete-clock: [rule_set_ip_cidr_accept_empty](#rule_set_ip_cidr_accept_empty)
:material-plus: [response_rcode](#response_rcode)
@ -166,6 +167,10 @@ icon: material/alert-decagram
"source_hostname": [
"my-device"
],
"preferred_by": [
"local",
"ts-dns"
],
"wifi_ssid": [
"My WIFI"
],
@ -496,6 +501,18 @@ Match source device MAC address.
Match source device hostname from DHCP leases.
#### preferred_by
!!! question "Since sing-box 1.14.0"
Match specified DNS servers' preferred domains.
| Type | Match |
|-------------|-----------------------------------------------------|
| `hosts` | Match predefined entries and entries in hosts files |
| `local` | Match hosts entries and neighbor-resolved hosts |
| `tailscale` | Match MagicDNS hosts and DNS route suffixes |
#### wifi_ssid
!!! quote ""

View file

@ -6,6 +6,7 @@ icon: material/alert-decagram
:material-plus: [source_mac_address](#source_mac_address)
:material-plus: [source_hostname](#source_hostname)
:material-plus: [preferred_by](#preferred_by)
:material-plus: [match_response](#match_response)
:material-delete-clock: [rule_set_ip_cidr_accept_empty](#rule_set_ip_cidr_accept_empty)
:material-plus: [response_rcode](#response_rcode)
@ -166,6 +167,10 @@ icon: material/alert-decagram
"source_hostname": [
"my-device"
],
"preferred_by": [
"local",
"ts-dns"
],
"wifi_ssid": [
"My WIFI"
],
@ -488,6 +493,18 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
匹配源设备从 DHCP 租约获取的主机名。
#### preferred_by
!!! question "自 sing-box 1.14.0 起"
匹配指定 DNS 服务器的首选域名。
| 类型 | 匹配 |
|-------------|--------------------------|
| `hosts` | 匹配预定义条目和 hosts 文件中的条目 |
| `local` | 匹配 hosts 中的条目和邻居解析得到的主机名 |
| `tailscale` | 匹配 MagicDNS 主机和 DNS 路由后缀 |
#### wifi_ssid
!!! quote ""