Shadowrocket REJECT Rules: How Blocking Works, Rule Order & Limits

Learn how REJECT blocks requests by domain or IP, how rules match from top to bottom, and what rules cannot block.

At a glance

REJECT refuses a connection when a rule matches; it is not a webpage element filter. For Shadowrocket users who already have their own configuration, this guide explains when to use domain or IP matching, where to place exceptions, and how to troubleshoot false blocks by changing one rule at a time. First, make sure Global Routing is set to Config, then verify which rules in the active Config are actually taking effect.

1. Where REJECT takes effect: match the target, then apply the policy

Each rule answers two questions: does the request match the condition, and what policy applies if it does? For example, in DOMAIN-SUFFIX,example.com,REJECT, DOMAIN-SUFFIX is the match type, example.com is the match value, and REJECT is the action. Once a rule matches, the connection is refused; a failed connection does not fall through to the next rule.

App sends a request Traffic enters the tunnel Check routing mode Match rules from top to bottom Apply the reject policy

This flow assumes the target traffic is handled by Shadowrocket. Editing a REJECT rule will not directly change a request's route if the connection is off, traffic bypasses the tunnel, or the current routing mode does not use these rules. Check the connection state, routing mode, configuration, and matching rule—in that order—instead of adding a batch of block rules first.

REJECT affects network requests; it does not remove text, image placeholders, or other content already displayed on a page. A refused request may show up as a failed resource load, a blank image, an app retry, or an error message. The result depends on how the app handles errors, so no single page change is guaranteed across all apps.

2. REJECT rule syntax: use domains first, and IP ranges with care

Use DOMAIN to block one exact hostname and DOMAIN-SUFFIX to cover a domain and its subdomains. Enter the hostname as the match value, without https://, a port, a path, or query parameters. For example, to match the host in https://ads.example.com/banner, enter ads.example.com, not the full URL.

Domain matching

DOMAIN
ads.example.com,REJECT
DOMAIN-SUFFIX
example.com,REJECT
What it matches
DOMAIN matches one exact hostname; DOMAIN-SUFFIX covers the root domain and its subdomains

Separate the rule fields with commas; do not include a URL path.

IP matching

IP-CIDR
192.0.2.8/32,REJECT,no-resolve
IP-CIDR6
2001:db8::8/128,REJECT,no-resolve
no-resolve
Does not actively resolve the target domain just to match this IP rule

IP examples are reserved for documentation; other services sharing an address may also be affected.

DOMAIN-SUFFIX,example.com,REJECT matches example.com and img.example.com, but not every domain that happens to contain that string. If you only need to block one resource host, do not widen the rule to the entire root domain. Login, image, and API services may use different subdomains under the same root domain.

IP-CIDR matches an IPv4 address or range. /32 represents one IPv4 address; /24 represents a range of 256 addresses. Applying REJECT to a large range on shared infrastructure may affect multiple unrelated domains. Since the IP behind a domain can change, blocking an address based on one lookup is not a reliable way to block that domain over time.

/32
IPv4 single-address prefix
/128
IPv6 single-address prefix
443
Default HTTPS port; do not include it in a domain rule

3. Rule order: put specific exceptions first and FINAL last

When traffic is handled by configuration rules, they are checked from top to bottom, and the first match determines the policy. A more specific rule later in the list does not override a broader rule that has already matched. A common mistake is to put a REJECT for an entire domain suffix first, then add an exception for a subdomain below it. That exception never gets a chance to take effect.

[Rule]
DOMAIN,account.example.com,DIRECT
DOMAIN-SUFFIX,example.com,REJECT
IP-CIDR,192.0.2.8/32,REJECT,no-resolve
GEOIP,CN,DIRECT
FINAL,DIRECT

In this ordering example, account.example.com matches the first rule and is not checked against the second; img.example.com is blocked by the suffix rule. GEOIP,CN,DIRECT matches using the destination IP's geographic database entry, not the webpage's language. Placing it before REJECT may allow requests that match its conditions.

Request targetMatching rule in the examplePolicy
account.example.comFirst rule: DOMAINDIRECT
img.example.comSecond rule: DOMAIN-SUFFIXREJECT
Connect directly to 192.0.2.8Third rule: IP-CIDRREJECT
Requests that match none of the preceding conditionsFINALDIRECT

FINAL is a fallback rule and has no domain match value. FINAL,DIRECT is used here only to complete the example; it does not mean you should change your configuration's final policy to DIRECT. Keep your existing final policy and insert only verified, specific rules in the appropriate place. Do not add a second FINAL to append block rules to the same configuration.

Takeaway: check for broader matches above a new reject rule

If a REJECT rule does not take effect, check for matching DOMAIN-SUFFIX, IP-CIDR, GEOIP, or FINAL rules above it. Appending more rules to the end of the file usually will not fix a rule-order problem.

4. Edit and verify rules in Config: add one at a time

The steps below refer to the Home, Config, and Settings interface. The exact editing controls may vary in the current app UI. First, keep a copy of the working configuration, then edit the Config that is currently selected. Do not assume a file is active based on its name, and do not mistake a subscription list refresh for an update to the configuration rules.

  1. Check the routing mode. On Home, check the connection status and Global Routing. Select Config to test configuration rules; Proxy and Direct are not modes for verifying rule matches in this guide. If you use Scene, first check the routing settings used by the active scene.
  2. Check the active configuration. Open Config and confirm which file is selected. Keep a copy, then find the [Rule] section. If it already exists, edit its entries rather than adding a duplicate structure at the end of the file.
  3. Add the smallest possible rule. Choose one exact hostname you know should be rejected. Add a DOMAIN rule before any relevant broad rules, leaving other existing policies unchanged.
  4. Save and apply. Confirm that the saved file is still the selected configuration, then apply it as prompted. If you need to reconnect, keep in mind that other network activity may be interrupted.
  5. Send the request again. Close and reopen the target page or app to establish a new connection if possible. Note the target domain, matching rule, and policy. If the logs do not show enough detail, a blank page alone is not proof that REJECT matched.
  6. Test by reverting one change. Remove the rule you just added, save, and repeat the same test. Compare the results before and after, then decide whether to keep the rule, narrow its scope, or investigate further.

Existing connections, browser cache, and app cache can all make changes look different from what you expect. Start by sending the target request again instead of changing several settings at once. Distinguish between “new request rejected,” “no new request made,” and “request succeeded but the display did not change”—each calls for a different next step.

5. Limits of blocking: shared domains, cache, and shared IPs

Domain rules can route traffic only using the target information they can identify. If the normal API and the content you want to block use the same hostname and differ only by URL path, DOMAIN and DOMAIN-SUFFIX cannot distinguish them. Setting that hostname to REJECT will often block the normal API as well.

REJECT can refuse connections to clearly identified targets, but it cannot promise to remove all promotional content or preserve page layout after blocking. Switching to protocols such as Shadowsocks, VMess, VLESS, Trojan, Hysteria2, or WireGuard does not give DOMAIN-SUFFIX the ability to read and filter webpage content. Outbound protocols and rule matching serve different purposes.

6. Common questions: rules not working, false blocks, and changes after updates

I added the rule. Why can I still open the target?

On Home, first confirm that Global Routing is set to Config, then check the selected file in Config. Look for an allow rule above REJECT that may match, then make a new connection and check the actual target. If the page is cached, seeing old content does not prove the network request was allowed.

Login stopped working after I added a rule. Should I turn off all rules?

First remove the rule you just added and test again. If login works, check whether the blocked hostname is used for login or verification. Narrow a broad suffix rule to the specific hostname you have confirmed. If a subdomain needs to remain accessible, add a specific exception before the broad REJECT and use an appropriate existing policy.

Why does my manually added REJECT rule seem to disappear after a subscription update?

Check the subscription content on Home and the rule file in Config separately. Updating a server list is not the same as updating a configuration file; downloading a remote configuration again may overwrite local edits. Compare your saved copy and confirm the file's source before restoring any necessary entries. Do not overwrite the entire file with an older copy.

Can I change FINAL to REJECT instead of adding rules one by one?

That would reject every request that does not match an earlier rule, not just one type of content. Unless you are deliberately building an allowlist and understand the impact, keep the existing FINAL policy and use specific DOMAIN rules or verified IP entries to control individual targets.

For long-term maintenance, record the target host, reason for each change, and how to revert it. If something is blocked by mistake, restore a working setup first, then investigate the target request. Avoid changing DNS, the outbound protocol, and the entire rule set at once, or it will be hard to tell what changed the result. For further troubleshooting, use the troubleshooting guide to check the active configuration and connection records.

This guide assumes you already have your own provider and subscription, and covers only local rule management. This site does not provide, sell, or recommend nodes, subscriptions, or connection services. A one-time app purchase does not include a connection plan, and adding a REJECT rule does not create a connection configuration.

Get Shadowrocket and keep reading

The iPhone and iPad app costs $2.99 as a one-time purchase on the App Store. The Mac (Apple Silicon and Intel), Windows, Android, and Linux versions are free. Choose your platform in the download guide. For iPhone and iPad, check the App Store listing for system requirements and verify the developer, Shadow Launch Technology Limited, and app ID 932747118.

Download Shadowrocket