Updated July 2026 · 6 min read
Add custom routing rules
The rules that ship with a subscription will never match your habits exactly. Adding a few of your own, to pin one domain to direct or to a specific node, is the most common edit people make.
Choosing between the common rule types
DOMAIN-SUFFIX covers a domain and everything under it, which handles about nine cases out of ten. DOMAIN is an exact match and applies only to the one name you wrote, which is handy for releasing a single login endpoint.
DOMAIN-KEYWORD fires whenever the word appears anywhere in the hostname. It looks convenient, but the blast radius is hard to predict: a keyword like google drags in a pile of unrelated third-party domains. Reach for a suffix rule when you can.
IP-CIDR needs no-resolve
IP-CIDR matches on the destination address range. The awkward part is that the core usually holds only a hostname, so to compare it against a range it has to resolve the name first, and the request waits an extra round trip.
Adding no-resolve at the end of the rule makes the core skip that entry for hostname requests instead of triggering a lookup. Any IP-CIDR rule sitting near the top of the table should really carry it.
Separate the three fields with commas and no stray spaces, and make the policy field match the proxy group name character for character, capitals and spaces included.
A rule in the wrong place does nothing
The core walks the table from the first line down, stops at the first match and never looks at the rest. Subscriptions routinely ship thousands of rules, so anything you place after them will most likely never get its turn.
Your own rules therefore have to go in front of the subscription rules. Where you write them matters too: put them in an extension rather than editing the subscription file, or the next update wipes your changes.
Confirming the rule actually fired
Save, apply again, load the target site once and find that connection on the Connections page. The row states which rule it matched and which policy group carried it, and if that matches what you wrote, you are done.
If the symptom is not one broken rule but every site failing, the syntax is probably wrong: the core refuses to load the whole config. Open the log, and the error usually points straight at the offending line.
What is the project?
Clash Verge Rev is a Tauri-based GUI for Mihomo with profile management, system proxy, TUN mode, rule editing and WebDAV backups.