On this page
- What the two errors mean
- The usual cause: a proxy client left its setting behind
- What you see, why, and what to do
- Windows: check and turn off the proxy
- macOS: check and turn off the proxy
- Linux and Android
- The browser and the terminal
- DNS_PROBE_FINISHED_NXDOMAIN with a VPN
- Veli doesn't use the system proxy
- FAQ
What the two errors mean
A browser set to use a proxy doesn't go to the site itself: it asks the proxy for it, and for an https site the proxy opens a tunnel (the CONNECT method) and passes the encrypted data both ways. Each error says which half failed.
- ERR_PROXY_CONNECTION_FAILED — the browser couldn't reach the proxy at all; Chrome's page says something is wrong with the proxy server, or the address is incorrect (Firefox: the proxy server is refusing connections). Nothing listens there: the program is closed, or the address or port is wrong.
- ERR_TUNNEL_CONNECTION_FAILED — the proxy took the connection but answered with a failure instead of a tunnel: the program behind it lost its server, a rule blocks the site, or a work proxy doesn't allow it.
The usual cause: a proxy client left its setting behind
Proxy clients such as v2rayN, Clash-based apps and NekoBox can run as a system proxy: they open a local proxy on 127.0.0.1 and write its address into the system's settings, so browsers send everything there. Closing properly, the program is supposed to put the setting back. After a crash or an uninstall, or when told to leave the setting alone, it doesn't, and the browser keeps knocking on a port where nothing listens.
v2rayN has system proxy options, among them “Clear system proxy”, which removes the address from the system, and “Do not change system proxy”, which leaves the setting as it is, an old address included. If the browser broke after you closed v2rayN, open it and choose “Clear system proxy”, or clear the setting by hand as below. Other causes:
- A setup script (PAC) — the system points to a script that picks the proxy, often served on 127.0.0.1 by the same kind of program.
- A browser extension — proxy switchers set the browser's proxy on their own.
- A work or school proxy — set by the admins, sometimes by policy; it may block sites or ask for a login. Ask them rather than change it.
- Environment variables —
http_proxy,https_proxyandall_proxysend curl, git and other terminal programs to a proxy.
What you see, why, and what to do
ERR_PROXY_CONNECTION_FAILED on every site after v2rayN, Clash or NekoBox was closed or crashed
CauseThe system proxy still points at 127.0.0.1, where nothing listens now
What to doTurn the system proxy off, or open the program and clear it there
ERR_TUNNEL_CONNECTION_FAILED while the proxy client is running
CauseThe proxy answers but can't open the site: its server is down or a rule blocks the site
What to doCheck the server in the client, or turn the system proxy off to test
Only one browser fails
CauseThat browser has a proxy of its own: a Firefox setting or an extension
What to doFirefox: “Use system proxy settings” or “No proxy”; turn proxy extensions off
curl, git or pip can't connect to 127.0.0.1, the browser is fine
CauseProxy environment variables, or git's own proxy setting
What to doRemove the variables;
git config --global --unset http.proxyThe proxy is off and DNS_PROBE_FINISHED_NXDOMAIN shows instead
CauseNames don't resolve: DNS, not the proxy
What to doSee the DNS section at the end
Windows: check and turn off the proxy
Open Settings → Network & internet → Proxy. Under Manual proxy setup, “Use a proxy server” should be off: if it is on, press Edit, turn it off and save. Under Automatic proxy setup, turn “Use setup script” off if you didn't set it yourself; “Automatically detect settings” can stay on. Then restart the browser.
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServerThe settings Chrome and Edge read. ProxyEnable 0x1 means on, 0x0 off; ProxyServer is the address, such as 127.0.0.1:10809. On, with a local port no program runs now, is the cause.
netsh winhttp show proxyA separate setting, WinHTTP, for Windows services and some programs, not the browsers. Direct access (no proxy server) is normal; an address you didn't set is removed with netsh winhttp reset proxy run as administrator.
macOS: check and turn off the proxy
System Settings → Network → Wi-Fi (or the connection you use) → Details → Proxies: turn off everything you didn't set yourself, the automatic proxy configuration included. Or from Terminal:
scutil --proxy
networksetup -getwebproxy Wi-Fi
networksetup -getsecurewebproxy Wi-FiHTTPEnable : 1 with HTTPProxy : 127.0.0.1, or Enabled: Yes with Server: 127.0.0.1, is a local proxy; ProxyAutoConfigEnable : 1 is a setup script. Other connections' names: networksetup -listallnetworkservices.
networksetup -setwebproxystate Wi-Fi off
networksetup -setsecurewebproxystate Wi-Fi off
networksetup -setsocksfirewallproxystate Wi-Fi off
networksetup -setautoproxystate Wi-Fi offTurns off the HTTP, HTTPS and SOCKS proxies and the setup script. If it asks for rights, put sudo in front.
Linux and Android
On Linux with GNOME the system proxy is in Settings → Network → Proxy, and in gsettings:
gsettings get org.gnome.system.proxy mode
gsettings set org.gnome.system.proxy mode 'none'The first line shows the mode: 'none' no proxy, 'auto' a setup script, 'manual' a proxy address. The second turns the proxy off; restart the browser if it doesn't notice.
- Android — Settings → Wi-Fi, open the network you're on (tap it or its gear icon), then Edit or Advanced options → Proxy → None; the path differs a little from phone to phone. The proxy belongs to that one network, so mobile data may work while this Wi-Fi fails.
The browser and the terminal
Chrome and Edge follow the system proxy. What they really use is on chrome://net-internals/#proxy (in Edge edge://net-internals/#proxy), and a proxy set by an organization's policy shows on chrome://policy.
Firefox has its own setting in Settings → General → Network Settings → Settings, where “Manual proxy configuration” keeps an address that outlives the program that needed it: choose “Use system proxy settings” or “No proxy”. Proxy extensions work past the system too: turn them off and try again.
env | grep -i proxyA line such as https_proxy=http://127.0.0.1:10809 sends terminal programs there. unset http_proxy https_proxy all_proxy clears them for this window (the capital names too); for good, remove them from ~/.bashrc, ~/.zshrc or ~/.profile.
Get-ChildItem Env: | Where-Object Name -like '*proxy*'Shows proxy variables. Permanent ones are removed in “Edit environment variables for your account” (search for it in Start).
DNS_PROBE_FINISHED_NXDOMAIN with a VPN
This one is not about the proxy: the site's name didn't resolve to an address. With a VPN on it is usually DNS: the DNS server the VPN uses doesn't answer, or doesn't know names that exist only in your local network, such as the router's page or a work site. Without a VPN, check the name for a typo first.
nslookup example.com
nslookup example.com 1.1.1.1The first asks the system's current DNS, the second asks 1.1.1.1. If only the second finds an address, change the DNS in the VPN client or the system; if neither does, the name doesn't exist. On Windows, ipconfig /flushdns clears the cache of names afterwards.