Rules are evaluated in order
In rule mode, the client checks conditions such as domains and addresses from top to bottom, then sends matching traffic to the assigned policy. Put specific domains that should connect directly first and the fallback MATCH rule last; the referenced policy must exist. Unlike global mode, rule mode doesn’t send every connection through the same outbound route. If one app misbehaves on your phone, check the connection log to see which rule matched before changing it. Subscription updates may overwrite rules edited directly, so use the client’s supported override or merge feature for lasting changes.
mode: rule
rules:
- DOMAIN-SUFFIX,example.com,DIRECT
- IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
- MATCH,DIRECT
This snippet uses a direct connection as its fallback and demonstrates rule order only. Set proxy policies to match names in your own configuration.
Import first, then check what’s active
A subscription URL is a configuration address from your service provider, not a webpage share link. Open the configuration page, choose import from URL, save it, and confirm that it’s active. A complete Clash YAML file is not the same as a nodes-only subscription, so a successful import doesn’t guarantee that all rules are present. Before updating, check whether local changes will be overwritten and back up important overrides separately. Subscriptions make it easier to sync changes than entering nodes one at a time, but their URLs can contain account details—hide the full address in screenshots and logs.
Configuration → New configuration → Import from URL
Save configuration → Set as current configuration
Update subscription → Check rules and proxy groups
See how to import a subscription →
Check system permissions and node connectivity separately
TUN is a virtual network interface that routes traffic to the core engine. Android clients typically use VpnService to create a local VPN tunnel. On the first connection, approve the system permission. A VPN icon in the status bar means the tunnel is up; it doesn’t confirm that a node is working. TUN covers more traffic than app-level proxy settings and relies more heavily on system permissions and background operation. Phones generally can’t run two standard VPN tunnels at once, so disconnect conflicting apps first. If the connection drops when the screen locks, check battery optimization instead of repeatedly switching nodes.
Android system VPN: Allow connection
App battery settings: Allow background activity
Other VPN apps: Disconnect before testing
After locking the screen: Check the client is still running
See Android permission and battery settings →
Start with a manual group to confirm the outbound route
A proxy group selects an outbound route: select lets you choose manually, url-test chooses based on test results, fallback switches to the next option in order when one fails, and load-balance distributes connections. Start with a manual group and confirm an outbound route works before trying automatic selection. Automatic tests aren’t real download-speed tests, and switching routes doesn’t guarantee that existing connections will move immediately. Proxy groups are easier to manage than a single fixed node, but group references, rule targets, and subscription node names must match.
proxy-groups:
- name: Manual
type: select
proxies:
- DIRECT
rules:
- MATCH,Manual
This example includes only the built-in DIRECT outbound. To use a proxy, add a node or policy name that actually exists in your configuration.
Low latency doesn’t mean fast downloads
A node latency test usually sends a request to a test address through a selected outbound route. Results depend on the handshake, DNS resolution, target site, and current network. Use the test to check basic connectivity, not to predict bandwidth, video quality, or whether every app will work. For a fair comparison, use the same test address on the same network; don’t compare Wi-Fi results with cellular data. If a test times out, first check that the subscription is valid and the node is available, then verify access in the app you actually use. Avoid running frequent batch tests on your phone, as they increase background network activity.
Choose the same test address
Run a manual test on the same network
Check real access in the target app
Recheck after switching networks
See common connection and testing issues →
First, check how the original configuration handles DNS
DNS resolves domain names to addresses. An override replaces or merges the DNS settings in a subscription with local settings. If a website won’t load but direct connections work, start by checking the DNS logs. Avoid changing private DNS on the device, client DNS, and router settings all at once, or it will be hard to pinpoint the problem. fake-ip uses virtual addresses to maintain domain mappings and isn’t suitable for every app. Understanding where DNS requests go matters more than simply switching resolvers; on mobile, also consider VPN coverage and app compatibility.
dns:
enable: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
nameserver:
- 1.1.1.1
This illustrates the fields; it isn’t a universal recommendation. Keep a copy of the original configuration and make sure your current network can reach the selected DNS resolver before making changes.