Rule keywords & policies
Rule
The configuration section that defines match conditions and actions is typically named [Rule]. More rules do not mean higher priority: rules are checked from top to bottom, and the first match applies. Put specific conditions before broader ones, then use FINAL as a fallback at the end.
Rule keywords & policies
DOMAIN
Matches one exact domain, for example DOMAIN,example.com,DIRECT. This rule does not automatically include subdomains such as www.example.com. Exact matching is easier to verify when you want to change the route for just one hostname.
Rule keywords & policies
DOMAIN-SUFFIX
Matches a domain and its subdomains, for example DOMAIN-SUFFIX,example.com,PROXY. It matches based on the domain suffix, not on an arbitrary string appearing anywhere. Use it to send requests across a domain family to the same policy without repeating rules.
Rule keywords & policies
DOMAIN-KEYWORD
Checks whether a domain contains a specified keyword, for example DOMAIN-KEYWORD,ads,REJECT. Short keywords may match unrelated domains, so this example is not a complete blocking solution. If it matches too broadly, narrow the condition or add a more specific exception above it.
Rule keywords & policies
GEOIP
Selects a policy based on how the destination IP is classified in the geolocation database in use, not on the webpage language or device region. Database classifications may differ from where a service is actually hosted, and the result can also depend on the IP address returned by DNS. For services with specific routing requirements, check more precise domain rules as well.
Rule keywords & policies
IP-CIDR / IP-CIDR6
Matches IPv4 and IPv6 address ranges. The number after the slash is the network prefix length. For example, IP-CIDR,192.168.0.0/16,DIRECT describes a private IPv4 range. An IPv4 rule alone does not mean the same service’s IPv6 address will also match.
Rule keywords & policies
FINAL
The policy used when none of the preceding rules match, for example FINAL,PROXY. It usually goes at the end of the Rule section; placing it earlier prevents later conditions from being checked. Choose PROXY or DIRECT as the fallback based on your configuration goals.
Rule keywords & policies
PROXY
When a rule matches, the request is handled by the currently selected proxy or the proxy policy defined in the configuration. This is an action, not a server address, and it does not specify a protocol such as Shadowsocks. To find out which connection will actually be used, check the selected server and how the configuration maps its policies.
Rule keywords & policies
DIRECT
Routes the matching request directly instead of forwarding it through a proxy server. It only sets the route for requests that match this rule; it does not switch every other request in the configuration to a direct connection. If the destination is unreachable, using DIRECT is no guarantee that access will be restored.
Rule keywords & policies
REJECT
Rejects matching requests, typically for connections you do not want to make. Rejecting a domain may also affect images, sign-in, or other features that rely on the same domain. If page content is missing, check the match logs before changing the condition.