Rule Keywords & Policies
Rule
Rules connect request characteristics to handling policies and are usually listed in the [Rule] section of a configuration file. They generally match from top to bottom, so earlier applicable rules can prevent later ones from taking effect. To understand a result, check the condition, position, and policy—not just whether a domain appears in the list.
Rule Keywords & Policies
DOMAIN
Matches an exact domain, for example DOMAIN,example.com,DIRECT. It does not automatically include subdomains such as www.example.com. To cover both a domain and its subdomains, understand the matching scope of DOMAIN-SUFFIX before choosing a rule.
Rule Keywords & Policies
DOMAIN-SUFFIX
Matches a domain and its subdomains, for example DOMAIN-SUFFIX,example.com,PROXY. It checks domain suffix boundaries; a matching string anywhere in the name is not enough. If a specific subdomain needs a different policy, put its exact-match rule before the broader rule.
Rule Keywords & Policies
GEOIP
Matches according to the target IP's classification in a geographic database. Results can vary with database updates, IP address allocation, and DNS resolution; they are not a real-time measurement of a server's physical location. If a domain rule and GEOIP produce different results, check rule order and the actual target IP.
Rule Keywords & Policies
IP-CIDR
Matches IPv4 address ranges, for example IP-CIDR,192.168.0.0/16,DIRECT. The prefix length after the slash defines the address range; it is not a server port. Use IP-CIDR6 for IPv6 ranges and keep address families distinct rather than copying an IPv4 rule as-is.
Rule Keywords & Policies
FINAL
A fallback rule used when no earlier rules match, for example FINAL,DIRECT. It usually belongs at the end of the rule list; otherwise, later rules may never get a chance to match. The policy after FINAL determines where unmatched requests go, not the route for every request in the configuration.
Rule Keywords & Policies
PROXY
A proxy policy identifier in a rule. It means a matching request uses the corresponding proxy route. It does not create a server or fill in missing authentication or transport parameters. Unlike Proxy mode in Global Routing, PROXY is the outcome of an individual rule and must be understood in the context of the current mode and selected proxy.
Rule Keywords & Policies
DIRECT
A direct policy identifier in a rule. It means the request is not forwarded through a proxy server. The request can still be affected by the local network, destination service, and DNS settings, so a direct connection can fail too. DIRECT does not turn off Shadowrocket or prevent other rules from taking effect.
Rule Keywords & Policies
REJECT
Rejects requests that match a rule, for example DOMAIN,example.com,REJECT. It handles requests; it does not remove visual elements from a page or distinguish all content hosted on the same domain. An overly broad rejection rule can also affect sign-in, images, and other features that work normally.