Official Manual · Config Reference

Shadowrocket Configuration Guide Rules & Match Order

This is a topic-based reference manual explaining how configuration files are organized, how requests match rules, and how policies and DNS affect the outcome. For your first import and connection, start with the setup guide; after getting started, return here to review each setting.

  • General / Rule
  • Host / URL Rewrite
  • PROXY / DIRECT / REJECT

Configuration File Structure: Separate Data from Rules

In Shadowrocket, server details and configuration files serve different purposes. Server details specify where to connect, which protocol to use, and how to authenticate. Configuration files define how requests are handled, which destinations connect directly, and which use a proxy policy. Seeing servers after importing a subscription does not mean the intended rules file is selected. Likewise, saving a file with a complete set of rules does not mean the proxy endpoints it references have usable parameters. When troubleshooting, verify these two parts separately.

Files in Config and the Active File

In Config, first check which file is currently active, then review the file you plan to edit. When the list contains multiple configurations, file names help identify them but do not prove that their contents are the same. Before editing, keep a copy and note the current Global Routing mode and selected server. If a change disrupts access, you can switch back to the original file for comparison. For remote configurations, also check how updates work to avoid having local edits overwritten by the source file.

Configuration files typically use sections, with section names in square brackets and settings or rules on separate lines. General contains common options, Rule defines request routing, Host specifies static hostname mappings, and URL Rewrite handles matching URLs. Each section has a different role; being in the same file does not make them one rule list that runs from top to bottom. In particular, do not paste Host entries into Rule.

[General]
bypass-system = true
dns-server = system

[Rule]
DOMAIN-SUFFIX,example.com,PROXY
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
FINAL,PROXY

Keep the Context When Reading Snippets

This is a minimal reference snippet: the two entries in General use equals signs for assignment, while Rule entries use English commas as separators. It illustrates the relationship between general options, domain rules, private-address rules, and the fallback rule; it is not a substitute for your server details. PROXY sends a request to the proxy policy, but the final route still depends on the active configuration and selected server. example.com is a reserved example domain. When adapting the snippet, use the actual destination to handle, not your provider's server address.

To read a rule, start with the rule type in the first field, then check the match target, followed by the policy and any optional parameters. For example, an IP-CIDR rule has an extra no-resolve parameter compared with DOMAIN-SUFFIX; it concerns DNS resolution for matching, not the policy name. FINAL has a different structure and no match-target field. When copying, preserve English punctuation and field order. Make sure your keyboard does not turn commas into full-width commas or add extra characters to section names.

Put comments on their own lines and explain why an exception is needed instead of merely repeating the rule. For snippets from other sources, first identify the section they belong to and any prerequisites, then decide where to insert them. Do not assume configurations with similar section names are interchangeable. Check Shadowrocket's in-app documentation for supported settings, optional parameters, and features. If an entry is not recognized, test it on its own.

Local Edits and Subscription Updates

Subscribe is mainly for updating server entries. Updating a Config file may change rules, DNS, or other general behavior. Even when both come from the same provider, they do not necessarily update the same content. Before updating, identify which type of content is involved, then check whether the selected server or rules file changed. Blaming every connection issue on an expired subscription can obscure a file switch or a replaced local exception.

After saving a configuration, return to the screen where you use it and verify that it is active; do not just confirm that the editor closed. Some options only affect new connections, while existing connections may continue using previously established channels. For a comparison, close old requests and start new ones. If you need to reconnect, save any work in progress first. See the setup guide for the full workflow; the remaining sections explain how to assess individual settings.

General & DNS: Resolution Is Not a Routing Policy

General settings affect basic behavior before and after requests are evaluated against rules, so their impact is usually broader than that of a single domain rule. DNS resolves domain names to addresses, Rule determines how requests are handled, and server parameters establish the proxy connection. These layers interact but cannot replace one another. A domain resolving does not guarantee that its service is reachable; a connection to a proxy server does not guarantee that every domain resolves appropriately.

Start with an Understandable Baseline

[General]
bypass-system = true
dns-server = system

Here, dns-server = system uses the system DNS source as a baseline. This helps you observe basic resolution behavior on the current network, but is not guaranteed to work on every network. bypass-system is a general setting for bypassing system traffic; do not treat it as an alternative way to send all private addresses directly. Decide whether to add specific address rules based on the destination, current network, and request records—not on what a setting's name might suggest it covers.

For initial troubleshooting, keep General options to a minimum so you can explain the effect of each change. If you replace DNS, add rules, and switch servers all at once, then a page starts working, you still will not know which change fixed it. A more reliable approach is to keep the server and Global Routing mode unchanged, modify one variable, retry the same destination, and record the result. Once access is restored, decide whether to keep the change.

Domain Rules and Address Rules Need Different Information

DOMAIN, DOMAIN-SUFFIX, and DOMAIN-KEYWORD rely on a recognizable domain in the request; IP-CIDR and GEOIP rely on address information. When an earlier domain rule already determines the policy, there is no need to perform an additional match against a later address rule. If evaluation reaches an address rule, the client may need the destination address. The resolution process and the resolution path used for the final connection are not necessarily the same, especially across different proxy protocols and remote handling methods.

Some requests are made to an IP address, or the client may not have enough domain information to match a domain rule. Even if the browser's address bar shows a website name, that does not prove every underlying request uses the same domain. Check individual connection records for the domain, destination address, match type, and policy. A page can use several domains, so inspect each failed request rather than testing only the homepage's main domain.

What to Check After Changing DNS

If an issue appears after switching networks, first check whether the same domain resolves on the current network, then check whether a new request actually uses the intended policy. Cached results can affect tests, and existing connections may not trigger a new lookup at all. Close and reopen the relevant page; if needed, reconnect using the app's available controls, then inspect the new records. Do not treat one successful refresh as a lasting result or conclude that resolution is faulty just because an address changed.

For local network resources, system DNS may resolve internal names; replacing the source arbitrarily can leave those names without a resolution path. Public domains may also resolve to different service addresses on different networks, which is not in itself a failure. Before changing DNS, check that the returned address is reachable, the request uses the right protocol, and the server certificate matches the domain. Visiting an HTTPS site by entering its IP address usually does not reproduce a normal domain-based request.

Do not use a Host mapping to mask a dynamic domain's resolution problem indefinitely. A mapping fixes the address, so after a service moves it may continue pointing to the old address and make DNS changes appear ineffective. If the same domain has both a Host entry and a domain rule, track them separately: the former changes the address source, while the latter determines the policy. Before removing a mapping, check whether a local service still depends on it to avoid creating a new access issue during troubleshooting.

When handling privacy or diagnostics, keep only the destination information you need. DNS records may reveal the domains you visit; remove personal service names, account identifiers, and subscription URLs before sharing screenshots or text. For further connection troubleshooting, use the steps in the setup guide to check authorization, server, and network status. Treat DNS as one specific layer to investigate, not as a universal explanation for every issue.

Domain Rules: Exact Matches, Suffixes, and Keywords

Domain rules are useful for specifying which policy a service should use, and are generally easier to maintain than constantly changing service addresses. Before choosing a type, decide whether you need to match one full hostname, a domain and its subdomains, or any domain containing a particular string. These types cover progressively wider scopes; do not choose the broadest just because it is shorter to write. The wider the scope, the more carefully you should check for unrelated requests it might match.

DOMAIN: Exact Hostname Match

[Rule]
DOMAIN,api.example.com,PROXY
DOMAIN,static.example.com,DIRECT
FINAL,PROXY

DOMAIN matches a complete hostname. The first line applies only to api.example.com; it does not automatically include example.com or deeper subdomains. Use it for a single endpoint or a specific exception ahead of a broader rule. Enter the hostname only—no https://, port, path, or query string. Those URL components are not DOMAIN match fields, and including them changes what the rule is meant to match.

Exact rules are easy to review because each entry corresponds to a specific service. The tradeoff is that when a page requests other domains, you need to check their policies separately. A match on the main domain does not mean login, images, verification, and API requests use the same route. For troubleshooting, get the actual hostname from the failed request record, then decide whether to add a rule. Guessing dependent domains from how a URL looks can miss the actual point of failure.

DOMAIN-SUFFIX: Match a Domain and Its Subdomains

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

DOMAIN-SUFFIX,example.com,DIRECT covers example.com and its subdomains. It matches by domain suffix, not by arbitrary string inclusion, so a different domain that merely contains the text example.com is not in the same scope. The example routes api.example.com through PROXY, then sends other requests under that domain through DIRECT. With the exact exception first and the broader rule after it, the relationship between the exception and default behavior is clear.

For a suffix rule, enter example.com rather than copying a full URL from the browser, and do not include a webpage path as part of the domain. Do not assume that *.example.com works here just because it is used in other syntaxes. If you need one hostname, prefer DOMAIN; use DOMAIN-SUFFIX when you need a group of subdomains. Choose the scope based on the service requirements, not on how many rules you want to maintain.

DOMAIN-KEYWORD: A Broader String Match

[Rule]
DOMAIN-KEYWORD,example,PROXY
FINAL,DIRECT

DOMAIN-KEYWORD checks whether a domain contains a specified string. It does not know whether that text is a brand, organization, or domain boundary, so example may appear in multiple unrelated domains. Use keyword rules only when you understand their scope; they can also help with temporary diagnostics, but do not replace a review of the target domains. Short, common, or broad business-related terms are especially likely to cause unexpected matches.

If a keyword rule comes before an exact rule, it can prevent the exact rule from handling those requests. The exact rule does not automatically get higher priority just because it looks more specific. Test three types of target: domains that should match, domains that should not match but contain the same text, and unrelated domains. The rule's scope is suitable for the current configuration only if both matches and exclusions behave as expected.

The Match Target Is Not the Server Name

A domain rule matches the request destination, not the server label shown on Home. Changing a server name does not change the match target for DOMAIN-SUFFIX; changing a rule for the destination domain does not fix server authentication parameters. If the same destination works in Proxy mode but fails in Config mode, first compare the matched policy and route rather than immediately re-entering details in Add Server. Verify changes to these two layers separately.

When reviewing existing domain rules, consider organizing them as exact exceptions, specific suffixes, then necessary keywords, and note the purpose of each group. Before deleting duplicates, compare their policies: the same domain with different policies is not a duplicate you can merge arbitrarily. To block a destination, you can change the policy to REJECT, but the same rules about match scope still apply. See REJECT Rules and How Blocking Works for details.

Address & Request Attributes: IP-CIDR, GEOIP, USER-AGENT

Address rules do not depend on a stable service domain; they use the destination address or its geographic classification. They can be useful for private networks, known address ranges, or broader follow-on classification, but cannot precisely describe the full scope of a website. A service may use several address ranges, and different services may share infrastructure. Treating an observed address as a permanent identifier for a website will make rules increasingly inaccurate over time.

IP-CIDR and Prefix Lengths

[Rule]
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
IP-CIDR,10.0.0.0/8,DIRECT,no-resolve
IP-CIDR,172.16.0.0/12,DIRECT,no-resolve
IP-CIDR6,fc00::/7,DIRECT,no-resolve
FINAL,PROXY

CIDR notation combines a network address with a prefix length. For IPv4, /32 represents a single address, while shorter prefixes cover larger address ranges. 192.168.0.0/16 does not mean “addresses whose last two parts are zero”; it describes an entire prefix range. The example shows common private IPv4 ranges and the IPv6 Unique Local Address range. These are syntax examples; decide whether to include them based on your actual destinations and network.

Routing private addresses directly only sets the policy. It does not create a local route that did not exist or connect identically named private addresses across different networks. A destination on another network still needs to be reachable. When multiple networks use the same private addresses, their meanings can also conflict. If a DIRECT match still cannot connect, check the current network, whether the target device is online, and whether its port is open instead of repeatedly widening the CIDR range.

What no-resolve Does—and Does Not Do

no-resolve avoids triggering DNS resolution solely to match that address rule. It does not prevent the entire request from using DNS, nor does it force a destination to connect directly. If a request already has a usable destination address, the address rule may still match. If only a domain is available and there is no usable address information, do not expect the rule to resolve it proactively and then match. When debugging, first establish what information was available in the request.

Whether to add no-resolve depends on the purpose of the rule. For a clearly defined private-address request, avoiding extra address matching for every public domain is often easier to reason about. For requests that need classification by resolved address, understand the resolution dependency that omitting the parameter may introduce. Do not mechanically add it to the end of every rule; DOMAIN and FINAL do not use the same field structure as address rules.

GEOIP Classifies Addresses, Not Website Ownership

[Rule]
DOMAIN,api.example.com,PROXY
GEOIP,CN,DIRECT
FINAL,PROXY

GEOIP,CN,DIRECT uses the available destination address and a geographic database. It does not determine location from website text, domain suffix, or the user's location. The address of a Chinese-language page is not necessarily classified as CN, and an address serving a page in another language may be. CDNs, address changes, and database differences can all affect results. GEOIP is better suited to broad classification after specific domain exceptions than to proving which organization owns a website.

TypeWhat It MatchesMain Limitation
IP-CIDRIPv4 address prefixAn address range is not the same as a website's full scope
IP-CIDR6IPv6 address prefixIPv4 rules do not automatically cover IPv6
GEOIPGeographic classification of an addressDepends on the destination address and database data
USER-AGENTA recognizable User-AgentDepends on request visibility and the actual field

USER-AGENT Is Not a General-Purpose App Selector

[Rule]
USER-AGENT,ExampleClient*,DIRECT
FINAL,PROXY

USER-AGENT matches the User-Agent field in a recognizable request. ExampleClient in the sample is placeholder text, not a reference to an actual app. This is not equivalent to routing by app process: multiple requests may use the same field, one app may send different fields, and some traffic may expose no readable field at all. For encrypted requests in particular, do not assume the client can automatically see their headers.

If a USER-AGENT rule does not match, first check whether the field is visible and whether its actual contents match the pattern, then check the rule's position. Do not broaden traffic inspection beyond what you need just to make one rule work. Any processing of encrypted content requires separate consideration of authorization, certificate trust, and privacy boundaries; the address and policy examples here do not require enabling additional encrypted-content processing. If a clear domain rule can express what you need, start by testing that instead.

Connection Policies and the Three Global Routing Modes

Rules tell the client which requests belong to a category; policies tell it how to handle those requests. PROXY, DIRECT, and REJECT are policy keywords used in rules. Config, Proxy, and Direct under Global Routing are modes that apply to overall operation. The two groups are related, but they operate at different levels. Before troubleshooting, note both the current mode and the matched policy; otherwise, you may mistake a change in mode for a fix to a rule.

PROXY, DIRECT, and REJECT

PROXY sends matching requests to the proxy policy. Whether a connection can be established still depends on the selected route, protocol parameters, authentication details, and current network. It does not guarantee access to every destination or create a server automatically. DIRECT connects to the destination directly through the network available to the device. REJECT denies matching requests, and the client may end the connection with a corresponding failure. It does not redirect the request to another server.

[Rule]
DOMAIN,api.example.com,PROXY
DOMAIN,local.example.com,DIRECT
DOMAIN,blocked.example.com,REJECT
FINAL,PROXY

The three examples show proxying, direct connection, and rejection; the domains are for illustration only. If api.example.com fails after matching PROXY, check the route next rather than assuming the client will fall back to DIRECT. If blocked.example.com matches REJECT, a failed connection is the expected policy outcome and is not evidence that the server is unavailable. Before testing, define what success means: access is allowed, a specific route is used, or the request is rejected as intended.

When to Compare Config, Proxy, and Direct

ModePrimary UseWhat to Check
ConfigApply the selected configuration's routing rulesFile, order, matched rule, and policy
ProxyCompare the proxy routeSelected route and server connectivity
DirectCompare the current network routeLocal network and direct reachability of the destination

These three modes are described to help structure troubleshooting; they do not mean every type of traffic is necessarily handled in the same way. System traffic, configured bypasses, and specific features may introduce other boundaries. For comparisons, use the same destination and a newly created request, keep the network environment consistent, and check the actual records. A status bar icon or one page loading cannot confirm the route used by every request.

If Proxy works but Config does not, first check whether the destination is handled by DIRECT, REJECT, or another earlier rule, then verify that the correct Config file is active. If both Config and Proxy fail, check the server address, port, protocol, and authentication details. Try another known-working destination to distinguish an overall route issue from a problem with one destination. Direct working shows only that the current network has a viable route; it does not prove that the proxy parameters are correct.

How the Selected Server Relates to Rule Policies

Understand the selected server in Home, the policy groups in the configuration, and the policy names referenced by rules in the same context. A simple configuration can use PROXY to send requests to the current proxy policy. If a more complex configuration references custom policy names, make sure those names exist and point to valid members. Do not copy custom names from someone else's file as if they were universal keywords, or assume that changing a server label keeps every reference valid.

Protocol parameters determine how the proxy connection itself is established. They sit alongside rule policies but form a separate layer. For Trojan, for example, fill in the address, port, password, and TLS-related parameters using your existing server details. Changing a rule from DIRECT to PROXY cannot fix incorrect authentication parameters. See the Trojan parameter guide for guidance on these fields; keep rules and server details as separate troubleshooting tracks.

REJECT also cannot meet every content-filtering need. A domain may serve both essential features and requests you want to block, so rejecting the entire domain could disrupt login, loading, or sync. For encrypted traffic, a domain-level rule generally cannot distinguish different paths on the same host. For finer control, first confirm which information is visible and understand the feature's limits rather than adding increasingly broad keyword rules.

After comparison testing, restore the mode you intend to use and test again. Temporarily switching to Proxy to verify a connection and forgetting to switch back to Config is a common reason rules appear ineffective. The same kind of misdiagnosis can happen if you switch to Direct and forget to restore the original mode. Recording the mode, server, and file together for each test is usually more useful for maintenance than keeping many success screenshots without context.

Match Order and FINAL: Stop at the First Match

The key to reading Rule is to evaluate each line from top to bottom. Once a request matches an applicable rule, that policy is used; evaluation does not continue in search of a “more specific” rule. DOMAIN does not automatically override DOMAIN-SUFFIX, and domain rules do not take precedence over address rules just because of their type. Priority starts with a rule's position in the configuration. Understanding this prevents more mistakes than memorizing additional rule keywords.

Put Exceptions Before Broader Rules

[Rule]
DOMAIN,api.example.com,PROXY
DOMAIN-SUFFIX,example.com,DIRECT
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
GEOIP,CN,DIRECT
FINAL,PROXY

This snippet first sends api.example.com through a proxy as an exception, then sends other requests under the same domain through DIRECT, followed by private-address and CN-address rules, and finally a PROXY fallback. Each line has its own purpose. If the suffix rule moves to the first line, api.example.com matches DIRECT before the exact exception can be evaluated. Comments and blank lines between rules do not change their order.

“Exceptions first” does not mean putting every DOMAIN rule at the very top of the whole file. It means that within an overlapping scope, narrow rules must come before broad ones. You can organize rules into groups by purpose, but check for overlap across groups. For example, an earlier DOMAIN-KEYWORD may already match several domains handled later; an address-range rule may also cover a destination that you want to treat specially. Group headings help people read the file but do not create new priority levels for the client.

The Structure and Placement of FINAL

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

FINAL is a fallback for requests that have not matched earlier rules. It takes only the rule type and policy; do not add a domain or address field. It usually belongs at the end of Rule. If FINAL appears too early, later rules cannot handle remaining requests. If a file contains multiple FINAL entries, do not treat them as a sequence of backup routes. Keep one clearly defined final policy and express exceptions with the specific rules above it.

FINAL,PROXY and FINAL,DIRECT specify different default behavior; neither is always correct. The former sends uncategorized requests to the proxy policy, while the latter connects them directly. Choose based on the default route you want and whether the preceding exceptions are complete. When copying a configuration, check the last line in particular: two files may share many rules but send a large number of unlisted destinations through different routes because only the fallback differs.

Trace Rules by Hand to Find Overlaps

To check a set of rules, trace a few representative destinations through them line by line: does the exact exception match first, do other hosts under the same domain reach the suffix rule, does a private address match an address rule, and do remaining requests reach FINAL? Record where evaluation stops each time, not just the expected policy. This exposes conflicts and explains why an apparently correct rule never appears in the match records.

When address rules are involved, also note whether a destination address is already available and whether no-resolve prevents that line from triggering a lookup. A paper walkthrough based only on a domain name, without address context, cannot reliably predict the result of GEOIP. If logs differ from your walkthrough, first check what destination information the client saw, then confirm which file is active. Do not delete all domain rules just to force address rules to match.

Merging two configurations does not mean concatenating their Rule sections. A FINAL in the first file may prevent every rule in the second from being reached, and a broad keyword may match exceptions intended for the second file. Instead, separate the sections, remove the fallback rules, merge specific rules by purpose, then add one FINAL at the end. Resolve conflicts between the same target with different policies manually; remove exact duplicate lines only after confirming they mean the same thing.

For a long configuration under active maintenance, treat each new rule as a small change to a local copy. Record its insertion point, match scope, intended policy, and test result. Consolidate similar rules later instead of adding every new rule to the top during troubleshooting. Keep the order clear and explainable. If only the maintainer remembers why a line is where it is, future updates and recovery become harder.

Host & URL Rewrite: Address Mapping and Request Handling

Host, URL Rewrite, and Rule often appear in the same configuration file, but they do not work in the same way. Host provides static address mappings for specified hostnames. URL Rewrite processes recognizable URLs based on match conditions. Rule selects the connection policy. They address where an address comes from, how a request is handled, and which route a connection uses. When an issue involves multiple layers, verify each one separately.

Host: A Fixed Resolution Result Does Not Choose a Route

[Host]
service.example.com = 192.0.2.10

Here, service.example.com maps to the example address 192.0.2.10. This address is from a documentation-only range and is not a reachable service. Host entries use an equals sign, not the comma-separated format used in Rule, and you cannot append PROXY to specify a policy. If the destination also needs a particular connection method, add a separate Rule entry and use actual connection records to confirm both the destination address and policy are as intended.

Host is suitable when a destination address is known and can be maintained; it is not suitable for arbitrarily pinning addresses for public services that change often. A domain may use regional routing, failover, or address rotation. Fixing a single address bypasses those changes and may stop working later. When adding a mapping, note its purpose, the conditions under which it is expected to remain valid, and how to remove it. Do not treat an address from one lookup as a permanent fix.

The domain in an HTTPS request is also used for certificate verification and service selection. Even if the mapped address accepts a TCP connection, the service may reject the request because of its certificate, SNI, or virtual-host configuration. A Host mapping does not give an arbitrary address a valid certificate for that domain or change server authentication parameters. If you see a certificate error, check the destination service configuration; do not disable verification instead of confirming the address is correct.

URL Rewrite: Understand the Match Scope First

[URL Rewrite]
^http://example\.com/old$ http://example.com/new 302

This example demonstrates a redirect for one exact path over plain HTTP: a regular expression matches the old address, the target URL points to the new address, and 302 indicates a temporary redirect. This is not a domain-routing rule and does not belong in the Rule section. The dot is escaped as a backslash followed by a dot to match the literal separator in the domain. Start and end anchors restrict the scope so the example does not also match longer paths or extra characters.

Query parameters in a URL also affect matching. The dollar sign at the end of the example means that a URL with an additional query string is outside its exact match scope. If query strings should be allowed, redesign the expression to match the actual requirement. Do not remove boundaries or add broad wildcards just to “make everything match.” Before editing, list examples that should and should not match, then test each one to reveal differences in paths, parameters, and escaping.

HTTPS Visibility and Redirect Loops

Being able to route by domain does not mean the full path and headers of an encrypted request are automatically visible. In HTTPS, the path is encrypted, so a domain rule alone cannot establish that URL Rewrite can process it. Further handling of encrypted content requires separate consideration of certificate trust, applicable domains, and privacy. The example uses HTTP so these extra prerequisites are not hidden in a seemingly simple rewrite snippet.

Rewrite rules can also create loops: the old address redirects to the new one, then another rule sends the new address back to the old one, causing repeated attempts or a too-many-redirects error. A target address may also still match the original expression, causing the same rule to apply repeatedly. During testing, inspect the redirect chain rather than only the final page. If you cannot explain each step, narrow the expression and temporarily remove overlapping rules.

To validate Host, leave Rule unchanged and compare only the source of the destination address. To validate URL Rewrite, start with a clear HTTP test URL, confirm the redirect, then check how the destination is routed. If you change all three sections at once, it will be difficult to identify dependencies even if the result works. For normal service requests, keep a copy of the original configuration so test rules do not affect login redirects, form submissions, or other stateful requests.

After updating the source configuration, review Host and URL Rewrite as well as Rule. An address mapping may be out of date, a service path may have changed, or a previously needed rewrite may now conflict with the new behavior. At minimum, maintenance notes should record the target, purpose, and conditions for removal. For entries with no clear source or purpose, disable them in a copy and test before deciding whether to delete them. This is easier to control than keeping unexplained rules indefinitely.

Validation & Maintenance: Trace One Request to One Change

The goal of configuration testing is not to prove that a file “looks complete,” but to explain each expected behavior through actual requests. A useful test should record at least the current network, Global Routing mode, Config file, selected server, target domain, and observed result. Without this context, different results from the same page may be caused by caching, an old connection, a network change, or a different route—not the rule you just edited.

Narrow the Problem Down in Four Layers

First, confirm the request is within the current client's handling scope: check that the connection is enabled, system authorization is in place, and the correct file is active. Second, verify the destination information is available, including its domain and address. Third, check whether the matched rule and policy are as expected. Only then check whether the selected route can establish a connection. This order helps avoid repeatedly re-entering server details when the server is fine but a request is matching REJECT by mistake.

Connectivity Test can help you assess connection conditions, but a successful test does not prove that every dependency of a real request will work. Different test methods may use different targets and protocols, and a page may request several domains. For an affected site, select one failed request and check its domain, address, matched rule, and failure stage before reviewing the page as a whole. Data statistics help you monitor usage; they do not, by themselves, prove that a particular rule matched.

Observed ResultCheck FirstNext Step
Rule did not matchActive file, mode, and earlier rulesTrace each line using the actual domain
Matched PROXY but still failedSelected route and server parametersKeep the destination fixed and compare in Proxy mode
Matched DIRECT but still failedCurrent network and destination reachabilityCheck the destination address, port, and resolution
Issue appeared only after an updateFile changes and route selectionCompare each item against the pre-update copy

Make small, reversible changes

Change just one rule or one related setting at a time, and keep the snippets from before and after the edit. If the result does not change, first check whether the request was re-established and whether an earlier rule matched; then decide whether to revert or investigate further. Do not keep stacking new exceptions without removing failed attempts—that adds variables to the next test. For a large configuration, start from a copy with only the necessary General settings and a few Rule entries to reproduce the issue in a minimal scope.

[General]
bypass-system = true
dns-server = system

[Rule]
DOMAIN,api.example.com,PROXY
FINAL,DIRECT

This diagnostic snippet routes one example domain through PROXY and sends all other requests to DIRECT by default. It is intended to make the test target clear, not as a general-purpose configuration for long-term use. Before applying it, understand that changing the default policy affects other requests. If it produces the expected result, add relevant groups from the original configuration back in to find which group changed the match. If it still fails, investigate domain information, the proxy route, and the destination service rather than widening the match scope.

Updates, Backups, and Sensitive Information

Keep configuration backups separate from server subscription details. Some files may contain servers, authentication fields, or links that identify you. Check the entire file before sharing, even if most of it appears to contain only rules. When preparing troubleshooting material, preserve section names, rule types, field structure, and order; replace real domains with example.com as needed, and remove account and subscription details. Do not just cover a small part of a screenshot and miss other identifying fields.

App updates are delivered through the App Store. For app access and purchase verification, see the purchase verification guide. Config updates, meanwhile, depend on the source of the file you use. Do not conflate these two types of updates, or assume that a first failed request after an app update means the rule syntax has changed. Check the file, mode, server, and network first, then confirm that each setting is still consistent with the in-app documentation.

For provider subscriptions, check before and after an update whether server entries were renamed, parameters changed, or the selected server is still valid. A single share link and a subscription link serve different purposes. If you are unsure what was imported, see Share Links vs. Subscription Links. This guide covers how to use information you already have; get server and subscription details from your service provider.

Finish with a regression test: choose one representative target for each of exact exceptions, domain suffixes, private addresses, and FINAL, and confirm the resulting policy. If you use Host or URL Rewrite, also check the mapping and redirect chain separately. Restore the Global Routing mode you intend to use after testing and keep a reversible copy. For common connection issues, see the setup guide; for traffic measurement, see Data Traffic Statistics. Maintaining a configuration with reproducible requests and clear change notes is more effective than continually adding rules.