This guide is for users with an active Shadowrocket connection who are ready to edit Config. First, make sure Global Routing is set to Config. Then add a REJECT rule for a specific domain, check rule order and request logs, and finish by handling exceptions and rollback. The goal isn’t to block more domains, but to document each rule’s scope, why it matched, and how to undo it.
1. Platform and setup requirements: back up Config first
Shadowrocket is available for iPhone, iPad, Mac, Windows, Android, and Linux. The iPhone and iPad app is available on the App Store for a one-time $2.99 purchase; check the App Store listing for system requirements. The Mac (Apple silicon and Intel), Windows, Android, and Linux versions are free. See the download guide for platform options. The steps below assume you already have a working configuration and don’t cover obtaining a connection.
Shadowrocket is a closed-source commercial app. Buying the app does not include a proxy service. This site does not provide, sell, or recommend proxy nodes, subscriptions, or proxy services. If your current configuration came from a service provider you use, save a copy before making changes and check whether future remote updates could overwrite your edits.
- Open Config and confirm which configuration file is currently selected. Editing a different file that isn’t active won’t change how current requests are handled.
- Copy or export your current configuration as a backup, and note the rules you plan to change and their original positions. Avoid changing DNS, server settings, and the rule chain at the same time.
- Go back to Home → Global Routing and select Config. The steps here assume traffic is routed according to configuration rules.
- Test the target page with the original configuration and note what works. Then add just one rule and repeat the same test on the same network.
2. What REJECT does: stop at a match instead of checking further rules
REJECT is an action, not a match condition. The rule’s DOMAIN, DOMAIN-SUFFIX, or DOMAIN-KEYWORD field determines which requests match; the trailing REJECT determines what happens to them. A match rejects the connection—it doesn’t try a direct connection first and switch to a proxy if that fails.
In a standard rule chain like the one discussed here, rules are checked from top to bottom, and the first match determines the action. FINAL is the fallback when no earlier rule matches, so it belongs at the end. If a broader allow rule comes first, a later REJECT rule won’t handle the same request.
[Rule]
DOMAIN,login.example.com,DIRECT
DOMAIN-SUFFIX,example.com,REJECT
FINAL,DIRECT
This example allows login.example.com to connect directly, rejects example.com and its other subdomains, and sends remaining requests direct. It illustrates rule order only; don’t use it as a general-purpose routing configuration or replace your existing file with it. If your configuration already has a [Rule] section, add the rules there rather than creating a duplicate section. Don’t replace the existing FINAL action without a reason.
3. Three domain conditions: start with an exact match
For domain blocking, start with DOMAIN. Use DOMAIN-SUFFIX only after confirming that the entire domain suffix should be rejected. The scope of DOMAIN-KEYWORD is the hardest to predict, so avoid matching on short words.
| Rule syntax | Match scope | Keep in mind |
|---|---|---|
DOMAIN,ads.example.com,REJECT | Exact match for ads.example.com only | Does not automatically match img.ads.example.com. |
DOMAIN-SUFFIX,example.com,REJECT | example.com and its subdomains | Matches api.example.com, but not notexample.com. |
DOMAIN-KEYWORD,tracker,REJECT | Requests to domains containing the string tracker | May affect unrelated sites; it does not distinguish by purpose. |
Enter only a domain or keyword as the match value—don’t include https://, a port, path, or query parameters. For example, to match the domain in https://ads.example.com:443/banner?id=1, enter ads.example.com, not the full URL. A domain rule’s scope also isn’t automatically limited just because a request uses TCP 443 or UDP 443.
Rule of thumb: if DOMAIN is enough, don’t broaden the match to the entire suffix
First confirm that an exact-domain rule blocks the target without disrupting login, images, or playback. Switch to DOMAIN-SUFFIX only if multiple subdomains genuinely belong in the same blocked scope.
4. Writing rules: list blocked domains and exceptions separately
These two cards show how to plan rules; the example domains are for syntax only, not a real blocklist. First identify the actual target in request logs, then add the necessary rules to the [Rule] section of the active Config.
Minimal REJECT rule
- Type
- DOMAIN
- Match value
- ads.example.com
- Action
- REJECT
- Full rule
DOMAIN,ads.example.com,REJECT
Retest with one target at a time; don’t add unknown domains.
Suffix rule with an exception
- Exception first
DOMAIN,login.example.com,DIRECT- REJECT rule after it
DOMAIN-SUFFIX,example.com,REJECT- Fallback position
- Keep the existing FINAL at the end of the rule list
- Rollback reference
- The Config backup saved before editing
Choose an exception action that matches how the service actually connects; DIRECT is not a universal choice.
GEOIP matches based on the region associated with the destination IP, while IP-CIDR matches an address range. Neither is a direct substitute for a domain condition. Multiple sites can share an IP address, so rejecting an IP may affect more than intended. Conversely, a domain can resolve to different IP addresses over time. A single IP entry in the logs isn’t enough to conclude that a domain rule failed.
- Keep the same format as your existing rules and separate fields with English commas. Don’t put quotation marks around the domain.
- Place a new exact-match rule before any suffix, keyword, or fallback rule that could match first.
- After saving, confirm this Config is still selected. If you see a syntax error, undo that one change before adding anything else.
- Save a record of local changes before updating a remote configuration. A server subscription update and a Config file update are separate operations; check which one is actually being updated.
5. Verify a match: distinguish rule behavior from what the page displays
A missing page element doesn’t prove that a rule matched, and no visible change doesn’t prove the rule failed. Caching, persistent connections, and server responses can all affect what you see. Verify the target domain, matched rule, and final action for a new request. Log locations and available fields can vary by platform, so use the information shown in your current interface.
- Check the routing mode. In Home → Global Routing, confirm Config is selected. Proxy and Direct do not route traffic through the standard rule chain described here. Scene behavior depends on its configuration; its name alone doesn’t tell you whether a REJECT rule will run.
- Generate a new request. After saving, reload the target page. If needed, close and reopen the app to avoid mistaking an existing connection or local cache for the result of the new rule.
- Check request logs. Find the request that just occurred and confirm its domain matches the rule and its final action is REJECT. If the log shows only an IP address, first check whether domain information is available for matching.
- Remove just this rule. Temporarily remove the new rule and repeat the same test. If the feature works again, restore the rule and test once more to see whether the issue returns. This helps avoid blaming a block for an intermittent network error.
- Retest essential features. Check login, verification codes, images, video playback, and form submissions. A shared domain may serve both analytics requests and essential APIs.
Connectivity Test can help check whether the selected server is reachable, but it can’t confirm that a particular domain matched a REJECT rule. A successful server test and a rejected domain request can both be true. Don’t use latency as a substitute for checking the target request in the logs.
6. Limits of domain blocking: it doesn’t inspect page content or remove empty spaces
A domain REJECT rule acts on matching network connections, not page elements. It doesn’t identify content by button text or on-screen position, and it can’t use paths such as /ads/ and /api/ on the same domain to reject one type of request but allow the other. Adding a domain rule doesn’t make HTTPS content readable for path-based filtering.
- Mixed content on one domain: If page content, login, and the resource you want to block all come from the same domain, rejecting it may also break essential features.
- Empty space on the page: After a request fails, the page may still show a blank area, an error message, or a retry control. Domain rules don’t rearrange page content.
- App retries: Some apps retry requests or switch to a backup domain. Repeated log entries don’t necessarily mean REJECT failed; check the target and action for each entry.
- Cache and existing connections: Rules affect requests that actually enter the matching process. Cached content doesn’t need a new network request, and existing connections may need to be re-established before you can see a change.
- Tunnel coverage: Traffic outside the scope of the current tunnel isn’t controlled by a rule just because it exists in Config.
Settings → On Demand controls automatic connection conditions; it doesn’t determine which domains should be rejected. When troubleshooting, first confirm the tunnel is connected, then check Config and the matching records. Repeatedly changing On Demand won’t fix a domain rule. DNS changes aren’t a universal fix either: first find out what matching information is missing, then decide whether to check DNS settings.
7. Common issues: no match, false positives, and rules disappearing after updates
The rule is saved, but why can I still open the site?
First, check that Home → Global Routing is set to Config, then confirm the selected Config is the file you edited. Generate a new request and check its actual domain. If an earlier allow rule matched first, change the order instead of repeatedly adding the same REJECT rule.
What should I do if login fails after adding DOMAIN-KEYWORD?
Remove the keyword rule first and confirm login works again. Check the domain in the failed request, then use DOMAIN to reject only the confirmed target. If you need to keep the broader rule, put exceptions for essential domains before it and use an outbound action that already works.
Why did my block disappear after an update?
First determine whether you updated the server subscription in Home or the remote configuration in Config. Refreshing the server list doesn’t refresh the rules file. If a remote Config was replaced, compare it with your backup to see whether your custom rules are still there, and check whether a different file is now selected.
The log shows REJECT. Why is related content still on the page?
Check whether the content is cached or comes from another domain, then reopen the page to generate new connections. A page can request resources from multiple targets; rejecting one doesn’t remove all related content. If the content shares a domain with an essential API, account for the limits of domain-level rules rather than broadening the block to the entire site.
For each custom rule, keep a record of three things: the target domain, why you added it, and which essential features you tested. If something breaks, remove the most recent rule first, then use your notes to narrow down the cause. This keeps your rule set explainable instead of prompting you to add more untested keywords after a false positive.
Shadowrocket downloads and configuration
The iPhone and iPad app is a one-time $2.99 purchase on the App Store; check the App Store listing for system requirements. The Mac (Apple silicon / Intel), Windows, Android, and Linux versions are free. The developer is Shadow Launch Technology Limited, and the app ID is 932747118. Get the app for your platform, then follow the setup guide to check your connection and Config before testing custom REJECT rules one at a time.
Go to downloads View the setup guide