4 scenarios · Complete YAML examples
Clash Verge use cases and config examples
Getting the rules right matters more than which client you run. This page walks through four real scenarios, and each one states the problem it solves, how to write it and how to confirm it works.
Last reviewed: 5 December 2026 · Applies to stable release v2.5.10
Before you begin: the four parts of a Clash Verge profile
Whatever the scenario, Clash Verge loads a single YAML file with four main parts. Once you know what each does, the examples below are easy to read.
- General settings: the listening port (the default mixed port is
7897), the running mode, the log level and so on. - Outbounds (
proxies): the destinations traffic can be handed to, such as a company gateway or a debugging tool on your own machine. The built-inDIRECTandREJECTneed no definition. - Policy groups (
proxy-groups): sets of outbounds plus a selection method, for example manual choice or automatic fallback when the primary is unavailable. - Rules (
rules): which requests go to which group or outbound, evaluated from top to bottom.
Scenario 1: Development and API debugging
The problem: while debugging an API you want only staging requests to pass through a local inspector such as Charles, Fiddler or mitmproxy, without every other app flooding the capture.
The approach: define the inspector as an outbound and point only the staging domains at it.
mixed-port: 7897
mode: rule
proxies:
- name: local-debugger
type: http
server: 127.0.0.1
port: 8888
rules:
- DOMAIN-SUFFIX,staging.example.com,local-debugger
- DOMAIN,api-test.example.com,local-debugger
- MATCH,DIRECT
How to verify: enable the system proxy switch and open a staging URL. The Connections page should list the request with local-debugger in its chain and the inspector should record it. Any other site should show DIRECT.
Going further: to debug a command-line program, match on process name instead, for example PROCESS-NAME,node.exe,local-debugger, and turn on TUN mode.
Scenario 2: Office networks
The problem: internal systems must be reached through a central gateway, yet pushing all traffic through it slows public browsing and loads the gateway needlessly.
The approach: send only internal domains and private ranges to the gateway, inside a fallback group so that an unavailable gateway is obvious in the interface.
proxies:
- name: office-gateway
type: socks5
server: gw.corp.example.com
port: 1080
proxy-groups:
- name: Intranet
type: fallback
proxies: [office-gateway, DIRECT]
url: http://intranet.corp.example.com/health
interval: 300
rules:
- DOMAIN-SUFFIX,corp.example.com,Intranet
- IP-CIDR,10.0.0.0/8,Intranet,no-resolve
- IP-CIDR,172.16.0.0/12,Intranet,no-resolve
- MATCH,DIRECT
Distribution: the IT administrator stores this file on an internal file server or Git repository. Staff import it into Clash Verge as a subscription with the update interval set to 1440 minutes (24 hours). A later change of gateway address means editing one file.
Scenario 3: Ad and tracker filtering
The problem: a browser extension only filters what happens inside the browser. Advertising requests and telemetry built into desktop software pass straight by it.
The approach: pull in a domain list through rule-providers and answer matching requests with REJECT. A rule set is a separate file that can refresh itself on a schedule.
rule-providers:
blocklist:
type: http
behavior: domain
format: yaml
url: https://files.example.com/rules/blocklist.yaml
path: ./ruleset/blocklist.yaml
interval: 86400
rules:
- RULE-SET,blocklist,REJECT
- DOMAIN-KEYWORD,adservice,REJECT
- MATCH,DIRECT
How to verify: search for blocklist on the Rules page to confirm the set loaded and shows an entry count. Rejected requests appear on the Logs page.
Our advice: keep the list conservative. An aggressive list breaks legitimate functions such as sign-in checks and payment callbacks. When a page misbehaves, look on the Connections page for a related domain being rejected.
Scenario 4: Split DNS
The problem: internal host names resolve only on the internal DNS server, but sending every query there makes public lookups slower.
The approach: use nameserver-policy to assign a DNS server to internal domains and leave the rest to public resolvers.
dns:
enable: true
ipv6: false
nameserver:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
nameserver-policy:
"+.corp.example.com": 10.0.0.53
"+.lan": 192.168.1.1
Where it lives in Clash Verge: Settings has a DNS override switch. With it on, you edit these values in a form and they take precedence over the DNS section of the subscription. Release v2.5.10 fixed that switch showing the wrong state, so upgrade first if you are on an older build.
System proxy mode versus TUN mode
This is the question new users ask most. Neither mode is stronger. They operate at different layers:
| Aspect | System proxy mode | TUN mode |
|---|---|---|
| How it works | Changes the OS network setting, which apps read for themselves | Creates a virtual adapter and handles traffic at the network layer |
| Coverage | Browsers and apps that respect the system setting | Nearly every program, including command-line tools |
| Privileges | Standard user | Administrator rights or an installed service |
| Traffic types | Mostly TCP | TCP and UDP |
| Best for | Everyday office work and browsing | Developers and special-case programs |
Our advice: default to system proxy mode. Turn on TUN only when the Connections page truly shows nothing from the program you are targeting. On Windows, install the service under Settings → Service mode before enabling TUN so the app need not be started as administrator each time.
A fixed order for troubleshooting
- Logs page: configuration syntax errors are reported here with a line number.
- Connections page: confirm the request reached Clash Verge and see which rule it matched.
- Rules page: confirm the effective order is what you intended, since a Merge override can change it.
- Port: make sure the default mixed port
7897is not taken by another program. - Version: confirm you are on v2.5.10. Many issues were fixed in recent releases.
Clash Verge configuration FAQ
In what order does Clash Verge evaluate rules?
Top to bottom, stopping at the first match. Narrow, specific rules therefore belong above broad ones, and the catch-all MATCH rule must be the final line. When a rule seems to do nothing, the usual reason is a broader rule above it matching first.
I changed the configuration but nothing happened. Why?
Check that you edited the profile that is currently selected, then look at the Logs page for a syntax error. Browsers reuse open connections, so older connections keep following the previous rules. Close all connections from the Connections page and try again.
My own rules vanish whenever the subscription updates. How do I keep them?
Do not edit the downloaded file itself, because each update replaces it. Use the global Merge override, or right-click the profile and choose to edit its rules. Changes made in either place are stored separately and re-applied after every update.
When do I actually need TUN mode?
Only when the program you care about ignores the system network setting. Some command-line tools, game clients and development SDKs behave that way. For browsers and ordinary office software, system proxy mode is sufficient and asks for fewer privileges.
Do thousands of rules slow things down?
Barely. The Mihomo core indexes domain rules, so matching against tens of thousands of entries typically takes well under a millisecond. DNS resolution and the quality of the outbound itself have far more effect. For large lists, prefer rule-providers to individual lines because they are easier to maintain.
What should I keep in mind on a work computer?
First confirm that your employer’s security policy allows this kind of network tool, and configure only outbounds that the organisation supplies or approves. Installing the TUN service on a managed device normally needs administrator approval. Do not use the software to get around network auditing or access controls.
Put a scenario to work
Install Clash Verge, copy an example above and swap in your own domains.