Connection troubleshooting

Clash connected but websites won't open: proxy and DNS fixes - Clash Official Website

A node has normal latency and the client says it is connected, but a browser or app keeps spinning. Connection records, DNS results, and matched rules show where the request is stuck.

  • No internet access
  • DNS
  • Troubleshooting
On this page

The node delay is normal, the client also shows that it is connected, but the browser or an application keeps spinning. The status on the page does not tell you whether the request has entered Clash. The connection record, parsing results and hit rules can clearly identify the stuck location.

Clash connected but websites won't open: proxy and DNS fixes - Clash Official Website

Open the same web page, and there is no new record on the connection page. The browser may not use the system proxy, and the application may not be included in the current takeover scope. After the connection record appears, check the domain name, hit rule, policy group and error text to determine whether the request stops at the local port, resolution, node or target service.

If only one app fails, check whether it appears in the app proxy list or bypass list. A working browser only proves the browser request took its path. The target app may use a different path, and interception differs across Windows, macOS, and Android, so check the page for your device.

Find the corresponding settings from the phenomenon you see

What you see on the pageWhere to watch
All websites immediately prompt that the proxy connection failedThe local address and port filled in by the system agent
Domains fail, but direct access by IP respondsDNS Settings and browser security DNS
The domestic website is normal, but the target site keeps timing outNodes, policy groups, and hit rules
The system agent is normal, open TUN and then disconnect allTUN Services, vNICs, default routes, and other VPNs
Only one application cannot be openedApply proxy lists, bypass lists, and apply your own error messages

system proxy and TUN, which path can open the web page?

Turn off TUN, leaving only the system agent and Rule mode. When the web page can be opened, the nodes and subscriptions can at least be used. The problem lies in the TUN service, virtual network card or routing; when both modes cannot be opened, check the local agent entrance and node status, and TUN can be placed later.

The direct connection test selects websites that can be opened by the current network. Even after closing the system agent, it cannot be opened. The fault is in Wi-Fi, broadband, enterprise authentication or router, and Clash cannot solve the local disconnection.

Is there any request for this connection page?

clears the connection record and opens a fixed domain name. There are no new requests, indicating that the browser, port, or application takeover method has not handed over traffic to Clash. Continue to change nodes and rules, and a request that does not enter the connection page will not appear.

After the request occurs, look at the target domain name, hit rule, policy group and error text together. DIRECT, REJECT, timeout and connection refused each point to different locations. The tray icon only reflects the running status and does not show the whereabouts of this request.

A fixed recurrence

  1. Reserves a configuration and node

    Turn off automatic switching to reduce page status changes.

  2. Clear connections and logs

    Let the next record correspond to the web page just opened.

  3. opens the same HTTPS address

    Check whether the request has entered the connection page, and the rules and errors displayed on the page.

  4. Only adjust one item at a time

    nodes, rules, DNS, TUN are modified separately, and the results are easier to compare.

A proxy error is reported as soon as the browser is opened

prompts that the proxy server cannot be connected as soon as the browser is opened. A common situation is that Windows or macOS still points to the old port of 127.0.0.1, and the current client is not listening. The mixed-port in the client settings is the actual entry, and the port status can be checked with netstat, lsof or ss.

curl -x If the direct request succeeds but the browser fails, it means that the system or browser proxy settings are inconsistent. curl -x also fails, check kernel, node and logs.

Check the local proxy entry (replace 7890 with the actual port)
# 将 7890 换成客户端实际端口
curl -I -x http://127.0.0.1:7890 https://example.com

# Windows
netstat -ano | findstr :7890

# macOS / Linux
lsof -nP -iTCP:7890 -sTCP:LISTEN

Domain name resolution error, browser's DNS should also look at

If a domain has no address, nslookup reports an error, or the result changes when browser secure DNS is disabled, inspect DNS settings. Disable browser DoH and compare the resolution paths and reachable nameservers used by the system and Clash. Browser, router, and Clash DNS can produce different results when all three are active.

After restoring the browser settings, choose a parsing path to keep it consistent. When 401, 403, 404 or 429 is received, it means that the request has reached the service. Process it according to the returned content. Do not continue to press DNS. Failure to understand.

Fake-IP address looks strange, connection logs may explain why

Fake-IP mode maps the domain name to 198.18.0.0/15. When the application connects to this virtual address, Mihomo still follows the original domain name matching rules. The connection page retains the domain name and the policy is correct, 198.18.x.x is part of the normal work.

After switching configurations, changing rules, or switching from Redir-Host to Fake-IP, the application will still use the old parsing results, and the web page will appear to be stuck. Close the test application, clear the system DNS cache, restart the kernel, and reopen the same page. One page keeps the old connection and the other keeps switching modes, and the results get mixed up.

NAS, printer, router backend and corporate intranet domain names need real addresses, put them in fake-ip-filter or give them to the intranet DNS. When checking, you can see the real address of the local domain name and the normal distribution of the public domain name, indicating that this part of the configuration has taken effect.

Clean DNS cache of Windows
ipconfig /flushdns

The request has entered Clash, the error text will point to a different location

What setting does the prompt on the connection page correspond to

The connection page displaysWhere it might be stuckView location
Timeout after DIRECTThe rule sends the request to a direct connection, or the local network or target service does not respondConfirm the path required for this domain name, adjust the precise rules and reopen the same page
Agent group dial timeoutThe current node, protocol, or remote endpoint is unreachableChange to a known available node and compare the same page
connection refusedThe port is not listening, or the system proxy is still pointing to the old portView mixed-port, process status and port occupation
Open TUN and then disconnect allConflict with service permissions, vNIC, default route, or other VPNRestore system agent, view TUN service and routing changes

When the same page appears in connection records and the error changes with a setting, the request is within the observable path. Keep the page, configuration, and node fixed, change one setting at a time, and map each result to that setting.

References