1. General settings: Find where traffic enters

When you open a config, start with the listening ports and operating mode, then trace which outbound route each rule selects. The five sections below are a reading order, not an instruction for the core to load top-level YAML keys in that order. Moving rules to the top of the file won’t change routing; swapping two rules in the rules list might change which policy matches.

mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
  • mixed-port: 7890 means HTTP and SOCKS5 proxies share a port. If an app is configured to use 127.0.0.1:7890 and you change the config to 7891, update the app’s port too. If the file uses port and socks-port, check the port for each protocol separately.
  • allow-lan: false is suitable when the proxy is only for this device. On other devices, 127.0.0.1 points to that device itself, not the computer running Clash.
  • mode: rule routes connections entering the core through rule matching. If the client is set to Global or Direct mode, switch back to Rule mode before testing rules. This helps avoid mistaking a mode difference for broken rules.
  • log-level: info is a good starting point for routine troubleshooting. Some GUI clients override the port and mode; when settings differ, check the current runtime state and core startup logs.

Listening on a proxy port doesn’t automatically capture system traffic. The system proxy works only with apps that honor system settings; TUN captures traffic through a virtual network interface and routing, and must be enabled separately with support from both the client and core. For troubleshooting, first point a single app directly at the mixed port and confirm the five config sections work together, then check the system proxy or TUN.

2. DNS: Separate upstream resolution from proxy routing

dns defines how the core handles DNS queries; it isn’t a proxy server list and doesn’t determine whether every app’s DNS requests reach the core. Check enable first, then enhanced-mode and nameserver. This minimal snippet is for reference; choose upstream servers based on what’s reachable on your network.

dns:
  enable: true
  enhanced-mode: fake-ip
  nameserver:
    - 1.1.1.1

In fake-ip mode, the core can return a synthetic address for a domain query it receives and store a mapping between the address and domain. When the connection later enters the same core, that mapping can help identify the original domain. A synthetic address doesn’t mean the upstream server returned an invalid IP or that the connection to the destination succeeded. If your config includes fake-ip-filter, check whether the affected domain is filtered. If a LAN service needs its real address, adjust the relevant domain rather than clearing the entire section.

DNS resolution failed? First identify which domain

  • Proxy server hostname: If a node’s server is a hostname, the core must resolve it before connecting to the node. mihomo supports proxy-server-nameserver to specify a resolver for these lookups; investigate this upstream separately only if your config uses that field.
  • Domain accessed by an app: An app may pass a hostname to the proxy, or resolve it first and pass an IP. A successful system lookup only confirms that particular system query returned a result. It doesn’t prove the core uses the same upstream or that domain-based rules received a hostname.

3. Proxies: Distinguish names, server addresses, and protocols

proxies is a list of proxy nodes. name is the name used to reference a node within the config; server and port specify its connection address. This Shadowsocks node illustrates how the fields fit together. proxy.example.com and the sample password are for demonstration only, not a working proxy.

proxies:
  - name: Example node
    type: ss
    server: proxy.example.com
    port: 443
    cipher: aes-128-gcm
    password: 'example-only'
  • type: ss specifies Shadowsocks. cipher and password must match the server settings; port: 443 alone doesn’t indicate HTTPS or enable TLS.
  • When renaming a node, update its name wherever it’s referenced in proxy groups, and check for rules that target the node directly. Names must match, including spaces and capitalization. Changing a label doesn’t change the server address.
  • If there’s no top-level proxy list, look for proxy-providers. Nodes may be loaded by a proxy provider and referenced through a proxy group’s use field. If the group has no nodes, check the provider’s update status first, then make sure the name in use matches.

Before editing a subscription config, check whether you’re editing a local copy or a file the client will overwrite on its next refresh. To keep local changes, use the client’s override feature or copy the config locally before editing. Logs and screenshots may contain server addresses, passwords, or subscription links; remove them before sharing.

4. Proxy groups: Trace the actual outbound route

proxy-groups organizes nodes, other referenceable proxy groups, and built-in policies such as DIRECT. The group’s proxies field is a list of names, not a top-level node definition list. When a rule matches a group, it only means that group was selected; the connection’s actual route depends on the group type and its current selection.

proxy-groups:
  - name: Manual selection
    type: select
    proxies:
      - DIRECT
      - Example node

Manual selection vs. latency-based selection

select lets you switch manually. In this example, DIRECT comes first for easy direct-connection testing, but an existing config may restore a previously saved selection, so check it before testing. url-test evaluates nodes using the probe URL configured for the group. interval is in seconds; for example, 300 sets a five-minute probe interval. A low probe latency doesn’t guarantee faster connections to every site. If results seem misleading, check whether the probe URL reflects the service you’re trying to reach.

5. Rules: Check match order from top to bottom

In Rule mode, the core checks routing rules in list order. When a rule matches, the connection is routed through the policy it specifies. Put precise exceptions first, broader rules later, and use MATCH as the fallback.

rules:
  - DOMAIN,docs.example.com,DIRECT
  - DOMAIN-SUFFIX,example.com,Manual selection
  - MATCH,DIRECT
DestinationFirst matching rulePolicy
docs.example.comDOMAINDIRECT
www.example.comDOMAIN-SUFFIXManual selection
example.orgMATCHDIRECT

If you swap the first two rules, docs.example.com will match the suffix rule first, so the exact-match direct exception won’t apply. Another common issue is that rules only see the destination IP—for example, when an app resolves the domain itself and passes only the IP to the proxy. In that case, domain rules have no hostname to match. Check what destination information the connection provides instead of adding more copies of the same domain rule.

If your config uses RULE-SET, look for the matching entry under top-level rule-providers and confirm the rule set has loaded. Its role differs from proxy-providers: the former supplies match conditions, while the latter supplies available nodes. See the configuration reference for rule syntax.

After editing: Validate the syntax, then test a connection

  1. Check the local file. Use spaces for indentation and keep indentation consistent at each level. Don’t add a second top-level rules just to include an exception; add it to the existing list. Quote string values such as passwords that contain # or a colon followed by a space, so they aren’t parsed as comments or YAML syntax.
  2. Validate with the same core. If you have the mihomo command-line program, run mihomo -t -f ./config.yaml from the config directory. If you use proxy or rule providers, also make sure the test uses the working directory and resources that match the client. A successful check means the core can read the config; it doesn’t mean a remote node is reachable. If you only use a GUI client, switch to the test config and look for the first error in the startup log.
  3. Make one explicit request. Enable the config and confirm mixed-port is listening on 7890. To test the example rules above, set “Manual selection” to DIRECT, then use the command below to access example.com. That domain also matches DOMAIN-SUFFIX,example.com. In Windows PowerShell, use curl.exe to call the executable explicitly.
curl --proxy http://127.0.0.1:7890 --connect-timeout 5 --max-time 15 -I https://example.com/

Compare the core logs or client connection records. First confirm the request reached the local port, then check the matched rule, proxy group, and actual outbound route. If the local port refuses the connection, check the listener and for port conflicts. If the expected policy matched but the connection still times out, investigate DNS, the outbound route, and the destination site. Change one thing at a time and retest with the same request to identify what changed the result.