September 9, 2026 · Advanced · About 10 min read

Shadowrocket Rules for Proxying Specific Websites: DOMAIN-SUFFIX and FINAL,DIRECT

Route selected domains through PROXY and send all other traffic DIRECT. Learn DOMAIN-SUFFIX and DOMAIN-KEYWORD syntax, rule order, and the FINAL fallback, with an editable example.

At a glance

To route only selected websites through a proxy in Shadowrocket, set Global Routing to Config, then add PROXY rules for the target domains in the active configuration’s [Rule] section and finish with FINAL,DIRECT. This guide is for users who have imported their own provider details and can connect successfully. It covers rule scope, saving and enabling the configuration, verifying requests, and troubleshooting unintended matches.

1. Check Config mode and the proxy route first

Check the active mode before editing rules. Home → Global Routing determines how traffic is handled. Editing a Config file alone will not give you the domain-based routing described here if Home is still set to Proxy or Direct. Server details and routing rules are separate: a working server does not mean the active configuration contains the right domain rules.

OptionWhat it doesFor this guide
ProxyHandles traffic in proxy mode without the domain allowlist routing described here.Switch to Config before testing the rules.
DirectHandles traffic in direct mode.You can’t use this mode to verify PROXY rules.
ConfigHandles traffic according to the currently selected configuration file.This is the option used in this guide.
SceneUses scene settings to determine how the app runs.For troubleshooting, start with Config to reduce variables from scene changes.

In these examples, PROXY is a proxy policy, not a server address. Don’t enter this word in the server’s Address field. If you use the default proxy policy, first check on Home that the selected server is available. If your configuration uses a custom policy group, check which option that group currently selects. DIRECT means the connection goes directly to its destination without using a proxy server.

2. Minimal DOMAIN-SUFFIX and FINAL,DIRECT syntax

To proxy example.com and its subdomains while sending other destinations DIRECT, use the snippet below as a starting point for your rules. The domain is an example; replace it with your own target domain. This snippet contains only [Rule], not a complete configuration file.

[Rule]
DOMAIN-SUFFIX,example.com,PROXY
FINAL,DIRECT

DOMAIN-SUFFIX matches on domain suffix boundaries. The rule above covers example.com, www.example.com, and api.example.com, but not notexample.com just because its name looks similar. Enter the domain itself as the rule parameter—not https://, a port, a path, or query parameters.

Shadowrocket checks rules in order, and the first match determines the policy for that connection. If you put FINAL,DIRECT before the target domain rules, it catches traffic first and prevents later rules from taking effect. When editing an existing configuration, check for broad rules earlier in the list too—a few lines appended at the end may not be enough.

3. Multiple websites and the limits of DOMAIN-KEYWORD

For multiple unrelated websites, listing rules on separate lines is usually easier to maintain. A page may load login, static asset, and API domains that don’t share the same suffix. Add rules for domains you see in actual requests rather than routing all traffic through a proxy just because part of a page isn’t displaying.

[Rule]
DOMAIN,login.example.com,PROXY
DOMAIN-SUFFIX,example.org,PROXY
DOMAIN-SUFFIX,example.net,PROXY
FINAL,DIRECT
RuleWhat it matchesWhen to use it
DOMAIN,login.example.com,PROXYThe exact domain login.example.com.When you need to match just one host.
DOMAIN-SUFFIX,example.com,PROXYexample.com and its subdomains.When you need to match a domain and its subdomains.
DOMAIN-KEYWORD,example,PROXYDomains containing the string example.Broader matching; check for unintended matches.

DOMAIN-KEYWORD doesn’t check whether domains belong to the same website, or require the keyword to appear at a specific domain level. For example, DOMAIN-KEYWORD,example,PROXY could match both example.com and notexample.net. It matches domain names, not page titles, page content, or URL paths. It can’t route just one page on a domain through a proxy.

Bottom line: start with specific domains, then broaden the match

For a small number of websites, prefer DOMAIN or DOMAIN-SUFFIX. Use DOMAIN-KEYWORD only when you’ve confirmed multiple target domains need the same keyword match, and test its scope against a non-target domain containing that keyword.

4. Five steps to save, enable, and verify your rules

After changing rules, confirm that the file is saved, the right configuration is selected, the running mode is correct, and new requests have been made. Existing connections may continue using their original sessions, so an already-open page in your browser can’t tell you whether the new rules are working.

  1. Check the route

    On Home, select a server you already have, then use Connectivity Test to check whether it’s reachable. The result only indicates connectivity to the test target; it doesn’t verify the rules for a specific website.

  2. Edit the rules

    Go to Config, open the menu for the configuration you plan to use, and select Edit Config. Check the [Rule] section and edit its existing rules—don’t add a second [Rule] section. Put target domain rules before FINAL,DIRECT.

  3. Select the configuration

    After saving, return to the Config list and select the file you just edited. Then go to Home → Global Routing and choose Config to avoid using another configuration or running mode.

  4. Make new requests

    Reconnect, then visit the target website and a website that isn’t on your list. If needed, close and reopen old pages to reduce the effect of browser caching and persistent connections.

  5. Review the request log

    In the in-app request log, check the destination domain, matched rule, and policy for each new connection. The target request should match a domain rule and use PROXY; a non-target request should fall through to FINAL and use DIRECT.

Change one thing at a time when testing. For example, if a website’s home page loads but its images don’t, check the image requests’ domains and policies before adding a rule for an asset domain. Don’t change the server, DNS, and the entire rule set at once, or you won’t know which change affected the result.

5. Handling existing GEOIP, IP-CIDR, and DNS settings

“DIRECT for everything else” works only if other traffic hasn’t already matched a proxy rule. Existing configs may also include GEOIP, IP-CIDR, or remote rule sets. Adding FINAL,DIRECT as the last rule does not override proxy rules above it.

192.0.2.0/24 is a documentation example range, not a real target to copy. For websites with dynamic addresses, shared hosting, or a CDN, domain rules are usually easier to maintain. An IP address from a single lookup may stop working when the address changes, or affect other domains sharing that address.

6. Distinguish rule issues from connection errors

First check whether the request matched the expected rule, then check whether the connection succeeded under that policy. You may see the English-language errors below when diagnosing a connection; the exact wording depends on the in-app log. An error by itself doesn’t prove that a domain rule is incorrect.

Connection refused

Cause: The destination or an intermediary explicitly refused the connection. This often happens when no service is accepting connections on the port at that address. What to check: If the log shows PROXY, compare the selected server’s Address and Port on Home with your existing server details. If it shows DIRECT, check the website’s destination and port. Don’t change FINAL as a first step.

Connection timed out

Cause: The connection did not complete before the timeout. A timeout alone doesn’t tell you whether the problem is with the route, destination, or network path. What to check: First verify the policy matched by the request, then use Connectivity Test to check the selected server. Test the target domain and a non-target domain separately.

If there are no connection errors but every website goes through a proxy, first check whether Home → Global Routing is still set to Proxy and whether broad PROXY rules remain near the start of [Rule]. If only one website routes incorrectly, check the domain used by the actual request instead of relying on the browser’s address bar.

7. Common questions about routing specific websites

How do I proxy just one subdomain?

Use DOMAIN,api.example.com,PROXY and place it before FINAL,DIRECT. To proxy api.example.com and its subdomains, use DOMAIN-SUFFIX,api.example.com,PROXY instead. Don’t use the suffix for all of example.com.

The website loads, but login or video doesn’t work. Why?

Check new requests made during the action and identify the domains used by the login API or media resources. Add rules for those domains one at a time, and only after confirming they’re part of the traffic that needs a proxy. The main domain in the address bar doesn’t represent every request the page makes.

Will updating my server subscription change the rules?

A server subscription updates server details; the rules in Config are separate. First check whether you’re updating a server subscription or a remote configuration file. The latter may replace your local edits, so keep a copy before updating and review [Rule] afterward.

Do I still need these rules with On Demand enabled?

Yes. Settings → On Demand manages the conditions for connecting on demand; it doesn’t replace target matching in [Rule]. If the connection state changes automatically while troubleshooting, note your On Demand settings, verify Config rules with a controlled connection state, then restore the automatic connection conditions you need.

Can I route traffic based on a URL path?

DOMAIN, DOMAIN-SUFFIX, and DOMAIN-KEYWORD don’t match URL paths. Don’t enter example.com/video in a domain field. These rules match domains or hosts, so they can’t distinguish between different page paths on the same host.

Verify the App Store listing