MIHOMO / CONFIG.YAML
Clash Configuration Guide
Look up proxy entry points, groups, rules, DNS, and TUN by field, from YAML structure to actual connection paths.
New to Clash? Start with the import, connection, and verification steps in the quick start guide. Use this page to look up fields, assess the impact of changes, and diagnose problems. Examples are based on the mihomo core; a client may override fields with the same names through its interface.
mixed-port: 7890
allow-lan: false
mode: rule
rules:
- MATCH,DIRECT
YAML Structure Overview
Top-level mappings, nested mappings, and lists
A configuration file's root is a mapping: an object made up of keys and values. Top-level mixed-port takes an integer, allow-lan takes a Boolean, and dns takes a nested mapping. proxies and proxy-groups are lists, and each list item is a mapping; rules is also a list, but each item is a string. When you encounter a field, first identify the data type it expects, then consider what the value means. For example, adding a target name as a newly indented line beneath a rule item does not replace a comma or create a valid rule.
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
proxy-groups:
- name: 'Manual Exit'
type: select
proxies:
- DIRECT
rules:
- DOMAIN-SUFFIX,example.com,Manual Exit
- MATCH,DIRECT
This file can be used to verify loading behavior without a subscription. Point a test program at the local mixed port. When it visits the example domain, the rule sends the request to “Manual Exit”; because the group contains only DIRECT, the connection is ultimately made directly from the local machine. Other domains use the final fallback rule. Both requests may use the same exit, but they match different rules, so connection details can help distinguish “the rule did not work” from “the rule matched and happened to use a direct connection.” If the corresponding request does not appear in the logs, first confirm that the test program is using this listening port.
Indentation and scalar types
The examples use two spaces for each indentation level. YAML does not require every project to use two spaces, but entries at the same level must align, and indentation must not use tabs. Pay particular attention to type, which follows name inside a list item: both are fields of the same object, so type must not be indented beneath the name value. When pasting configuration from a chat message, check that colons, commas, and quotation marks are ASCII characters. Full-width lookalikes may cause a syntax error or be silently retained as string content.
Use the intended types for integers and Booleans, such as 7890 and false. Do not rely on the core to convert quoted strings into numbers or switch values automatically. Conversely, quote values that are names consisting only of digits, comments beginning with a hash, or values containing colons and spaces to mark them clearly as strings. Empty values also differ: proxies: [] means an empty list, while a key with no value usually parses as null; do not assume both trigger the same default behavior. When combining several examples, merge top-level keys with the same name instead of expecting the parser to join their lists.
Valid syntax does not guarantee an active configuration
Divide troubleshooting into three layers. First, the file cannot be read: check indentation, characters, and structure. Second, the file parses, but the core rejects a field type, protocol parameter, or reference; for example, a rule that names a proxy group that has since been renamed can still fail to load even when the YAML is valid. Third, the configuration loads, but the system proxy, client-selected profile, or current operating mode does not send requests along the expected path. Confirm in the logs that the new file loaded successfully, then check connection records. Do not infer the cause from a single webpage opening or failing.
Most later examples describe one section and cannot be pasted together as a complete configuration without changes. When adding fields to an existing file, first incorporate the section shown, then check references in the other sections. Test domains do not automatically become proxy servers; replace an entire sample node with parameters supplied by an authorized source when a remote endpoint is required. For a first attempt, keep a working copy, use this chapter's direct-connection baseline to verify the client, then add one configuration section at a time. If the next load fails, this makes it easier to tell whether the problem came from the existing setup or the new fields.
Also distinguish between “the file exists,” “the client imported it,” and “the core is using it.” Some clients keep a separate copy after import, so edits to the original file are not synchronized. Others generate a final file at startup, and edits to that generated file may be overwritten on restart. Record the active profile name, where you made the change, and when you reloaded it to make troubleshooting comparisons meaningful. If the client provides a preview of the active configuration, use it to check the top-level structure first. Otherwise, verify a short path using an observable rule and listening port before checking more complex references.
Clash Proxy Port Settings and Operating Modes
Proxy entry points and the controller endpoint
port is an HTTP proxy port, socks-port is a SOCKS proxy port, and mixed-port accepts both types of connections on one port. Configuring one of these does not mean applications will use it automatically: browsers, command-line tools, and the system proxy may each have separate settings. For debugging, enable only the mixed port at first and point one program explicitly to the local loopback address. Once it works, decide whether you need separate ports. Do not make two enabled listeners compete for the same port on the same address. Port conflicts usually appear in startup logs and cannot be fixed by changing a proxy group.
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
external-controller: '127.0.0.1:9090'
rules:
- MATCH,DIRECT
external-controller provides an interface for managing the core; it does not carry web traffic. The control interface can read connection and runtime status and may also change some settings. This example listens only on the local machine. Omit this field if you do not need the control interface. If the client already manages it, there is no need to use the file to enable a second endpoint. Do not enter the controller port as a system proxy or bind it to a public address. In test setups where another local process manages the controller, set a password and limit local access using the method supported by the client. Do not expose credentials in public examples, subscription URLs, or troubleshooting screenshots.
| Field | Purpose | Common mistake |
|---|---|---|
port | Accepts HTTP proxy connections | Sending a SOCKS client to this port |
socks-port | Accepts SOCKS proxy connections | Changing the address but not the app's proxy type |
mixed-port | Accepts both proxy connection types on one endpoint | Assuming system apps connect automatically once it is enabled |
external-controller | Provides a core management interface | Treating it as an entry point for browser traffic |
Listening scope and platform differences
allow-lan: false is suitable for single-device use. To allow local network access, also check the listening address, the host address used by connecting devices, the system firewall, and the network's access boundaries. Setting 127.0.0.1 on another device will not connect to the machine running the client. Do not expand the listening scope just because a phone cannot connect: devices on the same Wi-Fi network may be isolated, and corporate networks may restrict this type of access. Verify locally on the device running the client first, then decide whether sharing is actually necessary. This avoids exposing a proxy endpoint intended for a single device.
Desktop system proxy settings usually affect only applications that follow those settings; command-line tools may use their own arguments or environment variables. On Android, VPN mode lets the system route traffic from selected apps into the client; the port fields and VPN switch are not the same thing. Some interfaces assign the system proxy port through global client settings rather than reading it directly from the subscription file. To check platform and architecture differences, see the client download and installation guide. For graphical clients, start with the Clash Plus entry for that platform, then choose from the platform options listed on the download page.
Use operating modes to narrow down problems
mode: rule selects an exit based on the rule list. direct mode sends traffic that has entered the core directly and is useful for comparing exits; it does not undo the system proxy or disable a virtual network interface. global mode uses the global selection instead of choosing a route rule by rule. Check where the global selection points in the client, or your test may still use a direct connection. After switching modes for troubleshooting, use a new request to verify the result. An existing connection may continue to reuse its established session and may not reflect the new exit.
Use the command below to check the local baseline. Any valid HTTP response means the request received a response through the proxy port; it does not prove that a proxy node works, because this baseline intentionally uses a direct connection. If the request is immediately refused, first check that the listener is running and the address matches. If it connects locally but then waits for a long time, distinguish between name resolution, upstream connectivity, and the target service's response. You can read startup logs at the info level. Increase verbosity only for short troubleshooting sessions, then restore it to avoid accumulating logs that contain visited domains and destination addresses.
curl --proxy http://127.0.0.1:7890 -I --max-time 10 https://example.com/
Proxy Node Fields
Node names, server addresses, and ports
Each node describes how to connect to an upstream. name is the reference name within the configuration, type tells the core which protocol to use for the remaining fields, and server and port point to the upstream endpoint. A node name does not change the remote address, but proxy groups and rules must reference it exactly. Spaces, capitalization, and invisible characters can all cause mismatches. Do not give a node the same name as a proxy group or use a built-in target such as DIRECT as its name. After merging a subscription, check carefully for duplicate names.
The HTTP node below demonstrates the basic structure. It assumes an authorized HTTP proxy is already running on another port on the same device. Without that upstream, the configuration can still illustrate the structure, but proxy connections will not succeed. A local test address helps separate node-field problems from cross-network routing issues. Do not set both the local entry point and the upstream to the same port currently used by the core, or requests may loop back to themselves. The rules keep a direct fallback and send only the specified test domain through the new node, preserving other access paths.
mixed-port: 7890
mode: rule
proxies:
- name: 'Local Test Upstream'
type: http
server: 127.0.0.1
port: 8081
rules:
- DOMAIN,example.com,Local Test Upstream
- MATCH,DIRECT
Protocol fields and transport parameters
The same server and port do not mean you can interchange type. SOCKS5, HTTP, Shadowsocks, and VLESS use different handshakes, so the client and server must use the matching protocol. When adding a node, confirm the protocol with its source, then check the corresponding field list. HTTP proxies and SOCKS5 proxies that require authentication can use their respective supported username and password fields. Shadowsocks generally requires a matching cipher and password, while VLESS requires matching identifiers and transport settings. Do not copy fields from another node just because the subscription contains similarly named entries.
For nodes that use TLS, distinguish three concepts: server is the actual connection target; the TLS server name is used for the handshake and verification and may be specified in a separate protocol field; and a path or request headers for a transport such as WebSocket belong to the transport layer. The server may specify these separately, so do not guess and enter the same address in every field. When migrating a node from an older configuration, identifying its protocol is not enough; also check the transport type and options supplied by the source. For certificate errors, check the name, device time, and trust chain instead of bypassing certificate verification to conceal a configuration mismatch.
UDP support and troubleshooting
Some node types support a udp setting, but actual data transport also depends on the protocol, upstream support, and whether the application's traffic enters the core. A working webpage verifies only that particular web connection; it does not prove that real-time voice or other UDP-dependent programs work. Conversely, a single program failing does not mean the node is completely unusable. First confirm the transport protocol and proxy endpoint used by the test app, then compare the network type, matched rule, and selected node in the connection details. Avoid changing node parameters and system routing at the same time.
When diagnosing a failed connection, treat “resolve the upstream address,” “reach the remote port,” “complete the protocol handshake,” and “access the target service” as four separate checkpoints. If the logs show that the node hostname cannot be resolved, check the resolver's startup dependencies. If the connection times out, check the port, network connectivity, and whether the upstream is listening. If the failure occurs during the handshake, check authentication, transport type, and server requirements. If only one target returns an error, distinguish a response from the target site itself from a forwarding problem at the node. Before testing, disable automatic policies that may change the exit or select a known node directly so both observations use the same upstream.
If a node comes from a remote proxy provider, its available names and node count may change after an update. Handwritten configuration that depends on a fixed node name may lose its reference when the subscription renames that node, even if the remote service is still online. A more reliable approach is to have business rules reference a stable local group name, then let the group consume nodes from the provider. Before viewing or sharing an active configuration, remove server-specific addresses, subscription links, and authentication parameters. To check a field's meaning, share only the necessary structure near the field with the error; there is no need to copy the full node list.
Clash Proxy Groups and Health Checks
Define a stable exit for rules to use
A proxy group does not create a new upstream protocol; it lets you choose among existing nodes, built-in exits, and other proxy groups. Once a rule uses a group name, you can change nodes within the group without editing the rule. A common structure uses a manual group as the entry point, with an automatic group and individual backup nodes as candidates; rules reference only the manual group. Choose a group name that describes its purpose, such as “Manual Exit” or “Work Exit,” rather than naming it after the day's node address. After a subscription update, you can then handle changes to candidates first and check whether rule behavior has changed.
select leaves the choice to the client interface and is useful for manually testing a node or fixing an exit. url-test checks candidate connectivity and response time using a probe URL, then automatically selects a suitable candidate. fallback prioritizes candidate order and uses the first available candidate, making it useful when candidates have a clear primary-and-backup relationship. These are not three names for the same speed test: they use different selection logic and may produce different results when a route is slightly slower but consistently reliable. If a single built-in exit is sufficient, there is no need to add another group layer.
proxy-groups:
- name: 'Manual Exit'
type: select
proxies:
- 'Automatic Probe'
- 'Test Upstream A'
- DIRECT
- name: 'Automatic Probe'
type: url-test
proxies:
- 'Test Upstream A'
- 'Test Upstream B'
url: 'https://example.com/'
interval: 300
tolerance: 80
rules:
- DOMAIN-SUFFIX,example.com,Manual Exit
- MATCH,DIRECT
To merge this section into a configuration, first declare two nodes with exactly matching names in proxies and make sure they can connect, or replace the candidate names with existing node names. A request passes through the inner group's selection only when the manual group has “Automatic Probe” selected. If the outer group is still set to direct, a successful inner-group probe will not change the request's exit. Groups can be nested in one direction but must not reference each other in a loop. When renaming a group, check all rule targets and candidates in other groups so you do not change only the definition and miss its references.
Probe URL, interval, and tolerance
url is a reachable probe target. Choose a stable address that responds quickly and permits this type of access. The example illustrates the fields and units; for production, select a target that suits everyday use. Do not treat one site's response time as a measure of a node's speed for every destination. interval is measured in seconds, while tolerance is measured in milliseconds; tolerance helps reduce frequent switching when candidates have similar results. More frequent probes are not always better: short intervals create extra requests and battery use on mobile networks, with many candidates, or when several groups repeat the same probes.
Speed test results apply only to the probe target and the moment of testing. A node may pass a probe but fail for real traffic due to target resolution, exit policies, regional restrictions, or long-connection quality. Conversely, a temporary problem with the probe target can make many nodes appear to fail at once. In that case, manually select the same node, test two different targets, and check the connection logs. If the manual connection works but the automatic group behaves unexpectedly, choose a more suitable probe target or wait longer before changing anything. Do not start by replacing the protocol, port, and node password.
Provider candidates and selection state
proxies lists candidate names within a group, while use references a provider name defined in proxy-providers. You can use both as needed, for example to combine nodes updated from a subscription with a fixed direct or backup option. If you filter candidates by name, a change to subscription naming may leave the group empty. Troubleshooting should start by checking whether the provider loaded, then which nodes appear before and after filtering—not just the speed status in the interface. Check provider health checks and group probes separately to avoid unnecessary duplication.
A selection group with the same name may retain its previous selection after a restart or update, depending on the client and core's persistence settings. Do not assume the first list item is the active choice; before publishing a change, check both the initial selection in a new environment and the actual selection in an existing one. If a group change appears to have no effect, use a new connection to check the matched rule, outer group, inner group, and final node in order. If that chain is correct but access remains unchanged, check whether the app is reusing a connection, proxy settings are disabled, or the current mode is not rule-based.
Routing Rule Syntax and Match Order
Rules are evaluated from top to bottom
Most rule entries consist of a type, a match value, and a policy target. DOMAIN matches a full domain name, DOMAIN-SUFFIX matches a domain and its subdomains, and IP-CIDR matches an IPv4 range; use IP-CIDR6 for IPv6 ranges. GEOIP matches a category based on an address database. The result depends on the data actually loaded by the client and does not indicate a domain's registration location or the service operator's location. MATCH has no additional match value and is commonly placed last as an explicit fallback. A target can be a declared node or group, or a built-in exit such as DIRECT or REJECT.
Rules use the policy from the first matching entry; they do not scan the full list and then choose the most specific match. If a suffix rule comes first, a more specific full-domain match for the same domain may never be reached. Put exceptions first, broader rules after them, and make the final behavior for unmatched requests explicit. To debug, inspect one representative request's connection details and note whether the core saw a domain or an address, what it matched, and which target it selected. Do not assume the core received the same domain just because it appears in the browser's address bar.
Local rule sets and references
rule-providers:
local-suffixes:
type: file
behavior: domain
format: yaml
path: ./rules/local-suffixes.yaml
rules:
- DOMAIN,blocked.example.com,REJECT
- RULE-SET,local-suffixes,DIRECT
- IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
- MATCH,DIRECT
Save the content below as ./rules/local-suffixes.yaml. Its relative location is based on the working directory passed to the core by the client, and it must be in a directory the client can read. Here, behavior: domain means the file contains only domain match expressions, not full rule lines with targets. Use behavior: ipcidr for network ranges. Entries under behavior: classical can include rule types and match values, but the final policy target is still set by the main file's RULE-SET line. Match the file format and category to its actual contents; a successful update does not guarantee that matching works.
payload:
- '+.example.com'
This rejects the example subdomain first, then sends other requests with the same suffix directly. Although the final fallback also uses a direct connection, connection records should show which rule matched so you can verify that the rule set was loaded. For an HTTP rule provider, specify its source address, cache path, and a reasonable update interval, and check that the source returns the declared format. Do not use the same cache path for two providers. Opening a remote address in a browser does not mean the core's update will use the browser's DNS or proxy settings. If the first download fails, start with the provider logs and working directory.
Address matching and when DNS resolution occurs
When a target enters as a domain and no earlier domain rule matches, some paths require resolving it before address-based rules can be evaluated. An address rule with no-resolve does not actively trigger resolution for that match. It may still match if the target was already an address or an earlier step has already obtained one. This is not a global DNS switch, nor does it promise that a later connection will not resolve the name again. For domain-based routing, check domain rules first and then network-range or geographic rules to avoid unnecessary resolution before the decision.
After a large rule update, if only some requests change, first check whether rule order is responsible rather than comparing only the new lines. One service may access its main site, static assets, and login endpoint, with each request matching a different rule. Choose a repeatable request as a sample and record its domain, policy, and operating mode together. If the request uses the fallback, check that the rule source loaded, that the match expression covers the domain, and that the upstream application gave the core enough information. For the placement of GEOIP and MATCH, see Rule Syntax and Priority.
For intercepted connections that contain only an address, domain rules may lack the information they need to match. Even with destination identification enabled, whether the domain can be recovered depends on the protocol and client support; it is not guaranteed for every request. Conversely, a direct-connection rule for a domain does not mean its DNS lookup will also use a direct path. Resolution depends on DNS configuration and the actual traffic path; rules determine the exit for the application connection. To distinguish the two, check both connection records and resolution behavior instead of using one DNS lookup as a substitute for all routing tests.
DNS Configuration and fake-ip
The core resolver is not the same as system DNS
dns.enable controls whether the core's DNS module is enabled. This switch alone does not mean the operating system and browser will send queries to it. Whether queries reach the core depends on the traffic path: an app may resolve names itself, or a proxy may resolve them on its behalf. A virtual network interface can intercept some conventional DNS requests according to its configuration, but enabling interception on a regular port does not automatically change encrypted DNS built into an app. Before troubleshooting, identify the type of request, who initiated it, and where it is sent; then decide whether to change core fields or app and platform settings.
nameserver configures upstreams for ordinary domain queries. default-nameserver provides startup resolution for DNS upstreams that need their own hostnames resolved and is usually configured with explicit addresses to avoid circular dependencies. If a node server is specified as a domain, use proxy-server-nameserver to handle that type of resolution separately. Startup can stall if the DNS needed to resolve a node server is reachable only through that node. Before configuring a dedicated resolver, verify that it is available before a proxy connection is established, then decide which upstreams should handle business domains.
dns:
enable: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
default-nameserver:
- 1.1.1.1
nameserver:
- 'https://1.1.1.1/dns-query'
proxy-server-nameserver:
- 1.1.1.1
fake-ip-filter:
- '*.local'
- 'localhost'
The example uses a public resolver to illustrate the fields. For production, replace it with a resolver that is reachable on your network and complies with organizational policy. Using an address can remove one startup dependency, but it does not remove routing or network restrictions. Internal office domains often require a designated resolver; a public upstream may return no result or an answer that does not work on the current network. If you use nameserver-policy to assign resolvers to specific domains, check the domain scope, upstream reachability, and whether that resolver actually serves the internal zone. Do not send every query to the same external address and try to patch the results afterward.
Virtual addresses, exceptions, and compatibility tests
fake-ip returns virtual addresses to apps while the core keeps a mapping between each address and its domain. When the connection returns to the core, the mapping can restore the domain so rules can select an exit. A virtual address is not the server's real address; seeing an address in this range in resolution output usually means the configuration is working, not that the resolver has failed. This mechanism requires the later connection to return through the same processing path. If the client intercepts resolution but the app's connection bypasses the core, the app may try to access the virtual address directly, so resolution works but the connection fails.
fake-ip-filter lets specific queries bypass virtual address allocation when a real address is needed. Local network discovery may also use multicast or platform-specific mechanisms, so filtering *.local handles only matching queries processed by this module; it does not replace the platform's local network discovery. After adding an exception for a domain, close old connections and consider clearing relevant app, system, and core caches before comparing results. If a lookup still returns an old address, check the cache and query path instead of repeatedly expanding the filter list. Otherwise, you may also change access that depends on domain mapping.
Separate leak checks from connectivity checks
To assess DNS leaks, first determine which resolvers are allowed and whether the system may retain other resolution paths. A test page reports the resolution clues it can observe; do not draw conclusions from a region or a single provider name alone. Public DNS services may use multiple addresses for recursive lookups, and their exit may differ from that of the app connection. For repeatable results, keep the client configuration fixed and observe queries from the browser and system tools separately. For requests that should pass through the core, confirm the access method, core resolution policy, and actual outbound path. Change one thing at a time, record the result, then restore any test switches.
If a domain fails while a known address remains reachable, check routing from the resolver to its upstream, startup resolution for node hostnames, and dedicated domain policies. If resolution succeeds but the app cannot connect, check virtual address routing and core mappings instead of replacing every resolver. If the difference appears only when VPN or TUN is enabled, continue by checking the interception scope. See DNS Leak Tests and fake-ip Troubleshooting for comparison steps, or the Glossary for field abbreviations.
Clash TUN Mode and Platform Interception
Switch from an app proxy to a virtual network interface
A regular system proxy relies on apps adopting the proxy settings. TUN uses a virtual network interface to receive traffic routed to it by the platform, then passes that traffic to the core. To determine whether an app is included, check more than the system proxy icon: check whether routes cover the destination address, whether the app is excluded, and whether the traffic comes from another network environment. TUN does not replace routing rules and does not mean every request goes to a remote node. After traffic enters the core, its current mode and configuration still determine whether it is sent directly, rejected, or proxied.
tun:
enable: true
stack: system
auto-route: true
auto-detect-interface: true
dns-hijack:
- 'any:53'
- 'tcp://any:53'
This section is for desktop environments where mihomo manages interfaces and routes; it is not a universal switch for every graphical client. stack selects the network stack implementation. The example uses the system stack; availability and behavior of other stacks depend on the core and operating system. auto-route tells the core to set the relevant routes automatically. auto-detect-interface identifies the outbound interface to reduce the chance of outbound traffic being sent back into the virtual interface. Multiple network adapters, other VPNs, network changes, and custom routes may all affect the result. Before switching network stacks, use the logs to confirm that the interface is established and receiving traffic.
| Platform | Access requirement | Check first |
|---|---|---|
| Windows / macOS | The client has permission to create an interface and change routes | Background service, active interface, and other VPNs |
| Android / iOS | The client requests access through the system VPN capability | System permission, app scope, and client support for the fields |
| Linux | The process can access the TUN device and configure routes | Process permissions, runtime environment, and existing routing policies |
DNS interception scope and routing conflicts
The example's dns-hijack sends matching conventional DNS requests that enter TUN to the core. any:53 without a transport protocol matches UDP; the next entry explicitly matches TCP. Neither entry intercepts all encrypted DNS or captures queries that never enter the virtual network interface. Use this with the core DNS configuration in the previous chapter, and check whether the client has already generated its own interception settings. Settings in both places may not merge as expected. On mobile in particular, the system VPN's DNS handling and app selection are generally managed through the client interface.
If local network resources become unavailable after enabling TUN, first determine whether an internal domain stopped resolving or routing to the actual address changed. Compare with a known address. If the address is reachable but the name fails, check whether the internal upstream is still available. If the address also fails, look for overlapping routes involving existing VPNs, virtual machine subnets, and automatic routing. Limit excluded subnets to ranges that are known to need the original path; overly broad exclusions can let traffic that should be intercepted bypass the core. Conversely, a direct-connection rule alone may not solve the problem because core egress and the system's original route can still be affected by the same routing conflict.
Separate troubleshooting into interface, traffic, and egress
First, confirm that the interface actually started. An enabled switch in the interface only requests activation; the logs should also show that the configuration was accepted and the interface created successfully. If permissions are missing or another service is using the interface, resolve the startup condition without changing rules. Second, make a request that behaves predictably when TUN is off and check whether it appears in the client connection logs when TUN is on. If there is no record, start with routing, app scope, and whether other proxy software intercepted the request first. If there is a record, check the matched rule and selected exit to make sure the request was not rejected or sent to a failing node.
Third, determine how much is affected. Failures to all destinations point more toward interception or outbound interface issues. Failures limited to business domains call for checking internal DNS or rules. If only a few long-lived connections stall, investigate path differences, packet size, and protocol support instead of immediately changing interface values copied from elsewhere. Keep a local control entry and a recoverable configuration while making changes. If the device is managed over a remote session, do not change the default route without a local recovery method. Use the client to turn TUN off normally, then confirm that old routes and system proxy settings have been restored.
On mobile, also consider the VPN sessions that the system can manage at the same time and the client's per-app settings. Allowing TUN in the file does not mean the system has granted VPN permission, and changing a proxy group will not bring an excluded app into the connection. For debugging, compare one app that is definitely within the interception scope with another that is explicitly excluded. If the same configuration behaves differently across platforms, first compare the active fields each one generates and its access mechanism. Do not treat a routing option supported by one desktop client as mandatory on mobile.
Subscription Overrides and Configuration Merging
Identify the source file, patch, and active result
A subscription is an update source, an override is a set of changes to that source, and the active configuration is what the core ultimately receives. A client may store these three in different locations. Editing the subscription cache directly is quick, but a refresh may overwrite your changes. Editing a file generated at each startup may also be undone on restart. For long-term maintenance, let subscriptions manage nodes, and keep settings specific to the local device—such as ports, rule exceptions, and DNS—in an override layer supported by the client. If overrides are unavailable, maintain a separate local configuration copy and compare it with source changes regularly.
There is no single “override file syntax” shared by every client. Some interfaces replace a top-level field with the same name; some recursively merge mappings; others offer dedicated options for prepending rules, appending nodes, or replacing a section entirely. YAML in the core describes the final configuration; it does not determine how the client merges earlier stages. Check the override controls and preview in your client first, then test whether a small change preserves fields you did not mention. If there is no merge preview, use an unimportant test domain to compare the final match before and after an update.
Check scalars, mappings, and lists differently
Scalars are usually easiest to verify. Change a port from its old value to a new one and confirm the interface, core listener, and app proxy address all use the same number. Mappings can cause unexpected results. For example, if you override only dns.enhanced-mode but the tool replaces the entire dns section, the existing resolvers, exceptions, and dedicated node resolution settings may all disappear. With recursive merging, the opposite problem may occur: you think omitted fields have been removed, but their old values remain. Before changing anything, specify whether you are “changing one child key,” “replacing the whole section,” or “deleting a key.” These operations are not interchangeable.
Rules are ordered lists, so appending, prepending, and replacing have very different effects. The following shows part of a final active configuration; it is not a patch that can be imported into every client. Suppose the original file already has a broad suffix rule and a fallback. To add an exception that rejects one test subdomain, place it before the rule that would otherwise cover it. If the tool supports only list replacement, include both retained and new entries in the complete list. If it supports prepending, submit only the exception and confirm in the preview that the original rules still follow it. Do not try to simulate a merge by declaring rules again at the end of the same file.
mode: rule
rules:
- DOMAIN,blocked.example.com,REJECT
- DOMAIN-SUFFIX,example.com,DIRECT
- MATCH,DIRECT
Nodes and proxy groups are also lists, but they contain references across sections. A client may not combine two objects with the same name; merging could leave duplicates or allow one definition to mask another. If you want to change a group's candidates, do not add another group with the same name as a patch unless the tool explicitly defines updates by name. In the preview, check the final group names, node names, and rule targets together, then confirm automatic groups have candidates. If names change during an update, either update dependent references or keep a stable local entry group so remote names affect only its candidates.
Verify after refresh and roll back if needed
Use a working configuration as a baseline and first save a change log that contains no credentials. After applying an override, reload it and confirm in the logs that parsing and loading succeeded. Then check the proxy listener, a test request that should match a specific rule, and a request that should use the fallback. Test DNS and TUN separately when they are involved. Next, run a manual subscription update and repeat the same checks. Testing only before an update will not reveal whether an override disappeared because files moved, remote fields changed, or merge order was adjusted. To compare two clients, keep the request and source configuration fixed, and record each client's interface overrides separately.
If something fails, disable the new override first and return to the verified configuration. Then restore changes one at a time in this order: ports, resolution, rules, and routing. Keeping the source file and patch separate means you do not need to reimport every subscription because of one bad rule. If a failure happens during an update while the old configuration still works, distinguish among an unexpected response from the subscription URL, a new field rejected by the core, and a cache that is still in use. See Subscription URLs vs. YAML Formats for endpoint formats. If you are still installing or importing, return to the quick start guide and follow the main steps again. For installers and common platform issues, see the download page.