· Troubleshooting · About 8 min read

How to Read Clash Logs: Understanding dial error, i/o timeout, and Other Errors

Learn how to change log levels and interpret common entries for connection timeouts, dial failures, and rule matches. Use logs to pinpoint whether a problem lies with a node, DNS, or rules.

Log Levels: Start with info to Capture a Request

This guide is for users who have imported a subscription and selected a configuration but are dealing with sites that won’t load, apps that bypass the proxy, or nodes that drop intermittently. Keep the client in the mode where the problem occurs. Don’t start by reinstalling the client or changing nodes and DNS at the same time. First, reproduce the failure and match it to the logs by timestamp.

  1. Open the client’s Logs page and make sure you’re viewing core logs, with no filter hiding entries other than errors. Close any speed-test panel to reduce noise from health checks and background refreshes.
  2. If the client offers a log-level setting, choose info. With a local Clash or mihomo configuration, set the top-level log-level to info, save, and reload the configuration. For remote subscriptions, use the client’s override feature where possible so an update won’t overwrite your local changes.
  3. Note the failing domain, current node, and time of the failure. Retry just once, then check for the domain and related warnings in the logs from a few seconds before and after. If the connection may have been reused, close and reopen the affected app before trying again.
log-level: info

info is usually enough to see connections and routing decisions. If the resolution process is unclear or the logs lack context around the failure, switch to debug temporarily and reproduce it once, then switch back to info. Log formats and fields vary by core version, client, and filter settings. Comparing key entries by timestamp is more reliable than matching screenshots found online.

Rule Matches: Check the Destination, Then the Route

A connection log might look like this. This example has been simplified for readability; field order can vary between versions.

[TCP] 127.0.0.1:52844 --> example.com:443 match DomainSuffix(example.com) using PROXY[Node A]
  • 127.0.0.1:52844 is the source address and ephemeral port for this connection, not Clash’s listening port. example.com:443 is the destination requested by the app, but it isn’t necessarily the remote address the core actually dials.
  • match DomainSuffix(example.com) means a domain-suffix rule matched. Rules are generally evaluated in list order. If a broad rule matches the domain first, a more specific rule listed later won’t take effect.
  • using PROXY[Node A] means this entry used the PROXY policy group and its selected outbound. If you see DIRECT, first check whether a direct connection was expected. If you see REJECT, check the reject rule before testing nodes.

If you’ve configured a domain rule but the log shows only a destination IP, first check whether the app gave the core a domain name or an IP address. Whether the core can obtain a domain for rule matching depends on how traffic enters the core and on settings such as DNS mapping and domain sniffing. The browser’s address bar alone isn’t enough to tell. If some requests from the same page use the proxy while others go direct, check the failing domains: the main site, login API, and static assets often use different domains.

A rule match doesn’t mean the page loaded successfully. It only tells you which route the connection took. Check separate entries for the handshake, response reads, and other requests the page depends on.

dial error and i/o timeout: The Error at the End Matters Most

dial error is a general indication that an outbound connection couldn’t be established; i/o timeout means a network operation timed out. Both can appear in the same log entry. Check the underlying error, operation, and address at the end of the message to determine whether the failure happened during DNS resolution, connection setup, or a read.

Log entryUsually indicatesCheck first
dial tcp …:443: i/o timeoutTimed out while attempting to establish a TCP connection to this addressDetermine whether the address belongs to a node or the direct destination, then compare the same destination using a different outbound
read tcp …: i/o timeoutThe socket connected, but a read operation timed outCheck whether timeouts are concentrated on the same node, site, or request stage
connect: connection refusedThe connection was actively refused, often because no service is listening on the port; a firewall may also refuse itCheck the actual port used by the node or local service, and determine whether the address is local or remote
lookup …: no such hostThe lookup returned no usable hostname resultCheck whether the lookup was for a node hostname or a site domain, then inspect the corresponding resolution path
connection reset by peerThe connection was reset, either by the peer or an intermediate network deviceCheck whether the reset happened immediately after connecting or after data had been transferred

For example, the request target in the log is example.com:443, but the error ends with dial tcp 203.0.113.8:8443: i/o timeout. If the node configuration points to that example address and port, check the connection to the node first; don’t assume the site’s port 443 is at fault. If the log only says context deadline exceeded, you can generally tell only that the operation exceeded its time limit. Check the surrounding entries to see which step ran out of time.

DNS Troubleshooting: Distinguish Node Domains, Site Domains, and Upstreams

First, Identify Which Name Failed to Resolve

If the node server is configured with a hostname and that hostname can’t be resolved, the core may not even have started connecting to the proxy server. If it’s the site domain that can’t be resolved, find out whether resolution is handled by the local system, the core, or the remote proxy. A site-domain failure and a node-hostname failure call for different fixes. Changing DNS for the entire system just because you saw lookup often discards useful diagnostic comparisons.

Next, Distinguish Resolution Failures from Upstream Timeouts

  • Only one domain fails: Check the spelling and the server address in your subscription first. On Windows, run Resolve-DnsName example.com to compare the system’s result, replacing the example with the failing domain when troubleshooting. This command tests system DNS; it doesn’t verify the resolution path mihomo is using.
  • Multiple domains time out: Check the upstream address in the logs and whether the current network can reach that DNS service. If system resolution works but the core fails, check dns.nameserver in the core configuration. In mihomo, if dns.proxy-server-nameserver is explicitly set, also check the upstream used to resolve node hostnames.
  • Resolution returns an address in 198.18.0.0/16: If mihomo has fake-ip enabled and the address falls within the configured fake-ip-range, it may be a virtual address assigned to the domain, not the site’s real address. Check whether subsequent connections also pass through the core so it can use the domain mapping.

No Connection Logs? Check System Proxy and TUN Routing

First rule out a log level that’s too restrictive, UI filters, and reuse of an existing connection. If the activity still doesn’t appear after you trigger it again, focus on how traffic enters the client. The system proxy relies on apps honoring proxy settings. TUN captures traffic through a virtual network interface and routes, subject to route scope and exclusions. If both are enabled, don’t assume an app’s route based on the toggle states alone.

If the client’s local mixed port is 7890, you can send an explicit HTTP proxy request from Windows PowerShell. If the port differs, use the value currently in effect; the example port isn’t a universal default.

curl.exe --proxy http://127.0.0.1:7890 --connect-timeout 5 --max-time 12 -I https://example.com/

This command sets a 5-second connection timeout and a 12-second total time limit, and requests headers only. If the request appears in the core logs but the original app’s request does not, check the app’s proxy settings or the scope of TUN routes first. If the command reports that it can’t connect to the local port, confirm that the core is running and that the listening address and port are correct. A successful command verifies only this explicit HTTP proxy route; it doesn’t show that TUN or UDP traffic is working.

Change One Variable at a Time: Isolate the Node, DNS, or Rule

  1. Suspect the node: Keep the failing domain and rule mode unchanged, switch to another node in the same manually selectable policy group, and test the same way. Record the outbound used each time; an automatic policy group may switch nodes between requests.
  2. Suspect DNS: Keep the node and rules unchanged. Check which domain failed and which DNS upstream received the request. Change only one relevant upstream at a time, and use a new connection for the retest if needed. This avoids mistaking a reused connection or cache hit for a fix.
  3. Suspect a rule: Check which entry matches first in the active configuration, including the destination domain, suffix, and rule order. After making a change, retest with the same node. Use the matched rule and actual outbound in the new logs as your evidence, not whether the page happens to load.

Keep one failed attempt and one comparison attempt. Note the client and core versions, operating mode, matched rule, actual outbound, and error tail. A node speed test shows only how its test request performed at that moment. To confirm the problem is fixed, retest the original failing destination.

Download the Latest Clash Version