{
"dns": {
"rules": [
{
"inbound": [
"mixed-in"
],
"ip_version": 6,
"network": "tcp",
"auth_user": [
"usera",
"userb"
],
"protocol": [
"tls",
"http",
"quic"
],
"domain": [
"test.com"
],
"domain_suffix": [
".cn"
],
"domain_keyword": [
"test"
],
"domain_regex": [
"^stun\\..+"
],
"geosite": [
"cn"
],
"source_geoip": [
"private"
],
"source_ip_cidr": [
"10.0.0.0/24"
],
"source_port": [
12345
],
"source_port_range": [
"1000:2000",
":3000",
"4000:"
],
"port": [
80,
443
],
"port_range": [
"1000:2000",
":3000",
"4000:"
],
"process_name": [
"curl"
],
"package_name": [
"com.termux"
],
"user": [
"sekai"
],
"user_id": [
1000
],
"invert": false,
"outbound": [
"direct"
],
"server": "local",
"disable_cache": false
},
{
"type": "logical",
"mode": "and",
"rules": [],
"server": "local",
"disable_cache": false
}
]
}
}
!!! note ""
You can ignore the JSON Array [] tag when the content is only one item
!!! note ""
The default rule uses the following matching logic:
(`domain` || `domain_suffix` || `domain_keyword` || `domain_regex` || `geosite`) &&
(`source_geoip` || `source_ip_cidr`) &&
`other fields`
Tags of Inbound.
4 (A DNS query) or 6 (AAAA DNS query).
Not limited if empty.
tcp or udp.
Username, see each inbound for details.
Sniffed protocol, see Sniff for details.
Match full domain.
Match domain suffix.
Match domain using keyword.
Match domain using regular expression.
Match geosite.
Match source geoip.
Match source ip cidr.
Match source port.
Match source port range.
Match port.
Match port range.
!!! error ""
Only supported on Linux, Windows, and macOS.
Match process name.
Match android package name.
!!! error ""
Only supported on Linux.
Match user name.
!!! error ""
Only supported on Linux.
Match user id.
Invert match result.
Match outbound.
==Required==
Tag of the target dns server.
Disable cache and save cache in this query.
logical
and or or
Included default rules.
Invert match result.
==Required==
Tag of the target dns server.
Disable cache and save cache in this query.