Overview
Rules are the part of a Clash profile that decide where each request should go. A rule normally follows the pattern TYPE,ARGUMENT,POLICY, with an optional no-resolve flag for rule types that would otherwise trigger DNS resolution.
The policy can be DIRECT, REJECT, a proxy name, or a proxy group. In day-to-day profiles, rules are usually ordered from specific to broad, and the final rule is normally MATCH.
Common rule types
DOMAINmatches one exact domain.DOMAIN-SUFFIXmatches a domain and all of its subdomains.DOMAIN-KEYWORDmatches domains containing a keyword.GEOIP,IP-CIDRandIP-CIDR6match resolved IP addresses or address ranges.PROCESS-NAMEandPROCESS-PATHmatch the application that initiated traffic when supported by the operating system.RULE-SETandSCRIPTare advanced or Premium-style matching mechanisms.MATCHcatches everything that has not matched earlier rules.
Examples
Put exact and high-priority rules first. Put broad rules such as GEOIP and MATCH near the end, otherwise they can prevent later rules from being reached.
Support Checks
If Rule mode does not behave as expected, check whether the request matches an earlier rule, whether the selected policy group has an available node, and whether DNS settings are forcing a different host or IP path.
Related pages
Reference examples
These examples mirror the corresponding Chinese documentation page so the English page carries the same configuration material.
# TYPE,ARGUMENT,POLICY(,no-resolve)
TYPE,ARGUMENT,POLICY(,no-resolve)