{
"dns": {
"rules": [
{
"inbound": [
"mixed-in"
],
"ip_version": 6,
"query_type": [
"A",
"HTTPS",
32768
],
"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",
"192.168.0.1"
],
"source_port": [
12345
],
"source_port_range": [
"1000:2000",
":3000",
"4000:"
],
"port": [
80,
443
],
"port_range": [
"1000:2000",
":3000",
"4000:"
],
"process_name": [
"curl"
],
"process_path": [
"/usr/bin/curl"
],
"package_name": [
"com.termux"
],
"user": [
"sekai"
],
"user_id": [
1000
],
"clash_mode": "direct",
"invert": false,
"outbound": [
"direct"
],
"server": "local",
"disable_cache": false,
"rewrite_ttl": 100
},
{
"type": "logical",
"mode": "and",
"rules": [],
"server": "local",
"disable_cache": false,
"rewrite_ttl": 100
}
]
}
}
!!! 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`) &&
(`port` || `port_range`) &&
(`source_geoip` || `source_ip_cidr`) &&
(`source_port` || `source_port_range`) &&
`other fields`
Tags of Inbound.
4 (A DNS query) or 6 (AAAA DNS query).
Not limited if empty.
DNS query type. Values can be integers or type name strings.
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.
!!! error ""
Only supported on Linux, Windows, and macOS.
Match process path.
Match android package name.
!!! error ""
Only supported on Linux.
Match user name.
!!! error ""
Only supported on Linux.
Match user id.
Match Clash mode.
Invert match result.
Match outbound.
any can be used as a value to match any outbound.
==Required==
Tag of the target dns server.
Disable cache and save cache in this query.
Rewrite TTL in DNS responses.
logical
and or or
Included default rules.