How to Read Clash Logs: Common Errors and How to Troubleshoot Them
Learn what Clash log levels mean and how to troubleshoot common errors, including dial tcp timeouts, DNS failures, unmatched rules, and port conflicts.
Log levels: use info by default; switch to debug when reproducing an issue
Runtime logs record events observed by the active core. A failed subscription update, an error in the client interface, and a core forwarding failure may have different causes. First, check the core name and version shown in the client, along with the name of the active configuration. The original Clash and mihomo do not use identical log messages, support the same fields, or offer all the same features. The examples below focus on common mihomo configuration and error keywords. Log snippets are illustrative, not from live testing.
info: Start here for everyday troubleshooting. Match the connection time, destination, rule, and outbound policy to the request you just made.warninganderror: Look for dialing, listener, and configuration-loading issues. At these levels, routine connection entries may be filtered out, so their absence doesn't mean no traffic was flowing.debug: Enable it briefly wheninfoisn't enough. Reproduce the issue once, then switch back toinfoto avoid burying useful clues in background traffic and to limit the retention of domain names and addresses.
Check the top-level field log-level: info in the active configuration. If your client supports persistent overrides, use one to adjust the subscription configuration, then confirm it reloads successfully. When reproducing the issue, note the time—for example, 14:32:08—and open just one page that fails. Look for entries from the same time and destination port. Node health checks and browser background sync generate their own connections; don't mistake their errors for the result of your test.
dial tcp timeouts: first identify the dialed address
dial tcp 192.0.2.10:443: i/o timeout means the TCP connection to that address didn't complete before the deadline. The IP here is an example for documentation. In a real log, first check whether the connection used DIRECT or a proxy group, then compare the reported address and port with the node's server and port settings. An outer connection entry may show the website's domain, while the actual dial is to the node server.
- It's dialing the node address: Keep the destination URL and network unchanged, and switch to another node in the current group. If the same URL works through another node, focus on the original node or the network path to it. If the same node times out only on a particular Wi-Fi network, compare results on another network using the same device.
- It's dialing the destination directly: Check that
DIRECTis what the rules call for, then see whether the destination is reachable on the same network and whether the failed address is IPv4 or IPv6. A single timed-out IPv6 dial doesn't prove the overall request failed; check for a subsequent successful connection. - It's not a timeout:
connect: connection refusedmeans the connection was explicitly rejected, so check the port and listener first. If the log reportsx509ortls handshakeafter dialing, investigate the system clock, certificate, server name, and handshake settings instead of blindly increasing the timeout.
DNS failures: distinguish system, core, and node-domain lookups
If you see no such host or dns resolve failed, note the name that failed to resolve. If it's the server domain for a subscribed node, investigate node-domain resolution first. If it's the website's domain, check which side handled DNS for that request. A DNS error explains the failure only when both the domain and timestamp match.
- System: Run
nslookup example.comon the same device and note which DNS server is shown. This command only reports the result for the path used by that query; it doesn't test browser secure DNS or mihomo's internal lookups. - mihomo: Check whether
dns.enableis enabled in the active configuration. Then see whethernameserver-policyassigns an upstream to the affected domain and whether that upstream is reachable. Read the full error to distinguish NXDOMAIN from a query timeout: the former means a reply said the domain doesn't exist; the latter means no reply arrived in time. - Node server domain: If
proxy-server-nameserveris configured, check whether that upstream can resolve the domain on its own. If resolving the node's domain depends on the same proxy route that hasn't been established yet, break the circular dependency first.
With enhanced-mode: fake-ip enabled, getting an address from the configured fake IP range is expected. For example, if fake-ip-range is 198.18.0.1/16, a result of 198.18.0.12 doesn't mean public DNS returned a bad record. Next, confirm the following connection reached the core handling that mapping, and check whether the connection entry links back to the original domain.
Unmatched rules: distinguish traffic that never reached the core from traffic sent to the fallback
If info shows a connection entry with MATCH, then in rule mode none of the earlier rules matched. If there's no entry for the connection at all, check the traffic path first: the system proxy only covers apps that use its settings, and some apps or UDP traffic may take another route. With TUN, confirm it's running, the destination route goes through TUN, and the traffic isn't excluded. Prove traffic is reaching the core before changing rules.
In rule mode, rules are checked in order, and the first match takes effect. This snippet assumes Proxy-Group is defined in the configuration and uses MATCH as the final fallback:
mode: rule
rules:
- DOMAIN,api.example.com,DIRECT
- DOMAIN-SUFFIX,example.com,Proxy-Group
- MATCH,Proxy-Group
A request for api.example.com that reaches the core with its domain intact should match the first rule. Move the suffix rule to the top, and the same request will go to the proxy group. Also check that the client hasn't switched to Global or Direct mode. If a connection only shows the destination IP and the core can't recover the domain from a DNS mapping or enabled sniffing, domain rules have nothing to match against. After editing the configuration, test with a new connection; existing connections can't confirm whether the new rule works.
Port conflicts: identify the listener and process before changing proxy ports
If startup logs show listen tcp 127.0.0.1:7890: bind: address already in use, the TCP listener couldn't bind to that address. The example uses 7890; use the port shown in your own log. Check whether the error refers to mixed-port, external-controller, or dns.listen. Changing the wrong field leaves the conflict in place and may point the system proxy at the wrong port.
- Windows PowerShell: Run
Get-NetTCPConnection -LocalPort 7890 -State Listen, note theOwningProcess, then find that PID in Task Manager's Details tab. - macOS: Run
lsof -nP -iTCP:7890 -sTCP:LISTEN. On Linux, runss -ltnp 'sport = :7890'; you may need appropriate permissions to see process details. - If the error specifically says
listen udp, check the UDP endpoint instead. On Windows, runGet-NetUDPEndpoint -LocalPort 1053, replacing1053with the port shown in your log.
If another running client is using the port, quit that client normally and try loading the configuration again. If another service needs to keep the port, assign a free port to the conflicting listener and update any settings that depend on it. For example, if you change the mixed port from 7890 to 7897, update any manually configured system or app proxy to use 7897 too. After restarting, confirm the listener starts successfully, then make a new request.
Retest in order: listener, traffic path, rules, outbound connection
- Fails at startup: Start with the first configuration-loading or listener error. If the message gives a YAML line number, check that line and the indentation, colons, and list structure just above it. Then confirm you're editing the active configuration.
- Starts successfully, but there's no matching connection: Check the proxy address and port the app is actually using. For apps routed through TUN, check the interface and routes. Don't switch nodes before the traffic path is working.
- Connection appears, but the policy is wrong: Note the mode, destination domain or IP, matched rule, and node actually selected within the group. Then check rule order and configuration overrides.
- Policy is right, but the connection fails: Read the innermost error and find the first failing stage: DNS resolution, TCP dialing, or the handshake. Change one thing at a time, retest the same destination, and keep the relevant logs from before and after each change.
When asking for help, include your operating system, client and core versions, current mode, whether TUN is enabled, and a few log lines around the time you reproduced the issue. Keep the error type, destination port, and rule type; redact subscription URLs, access tokens, node credentials, and any addresses you don't want to share. This is usually enough to tell whether the problem is with the traffic path, rules, or outbound connection.