Skip to content

Why Does a VPN Work in Linux Terminal Tools but Not in a Browser?

When curl, ping and apt behave while Firefox or Chromium will not load pages, the tunnel is usually fine and the browser is taking a different path. Here is how to find which one.

10 min readUpdated Nov 11, 2026By XPASS Editorial Team

Why Does a VPN Work in Linux Terminal Tools but Not in a Browser?

It is a confusing situation. You connect the VPN on your Linux desktop, run curl in a terminal, and the page comes back. ping replies, apt update finishes, git pull works. Then you open Firefox or Chromium and the same site spins, times out or shows a name-not-resolved error. It feels as if the VPN is half working, but that is rarely the real picture. In most cases the tunnel is carrying traffic correctly and the browser is simply taking a different path to the same destination.

This article explains the usual differences between a terminal tool and a browser, gives you a short set of commands to find the failing layer, and lists the fixes that go with each cause. It is general Linux diagnostic guidance. It does not assume a particular distribution, and it does not claim any special behaviour from a particular VPN app. If you still need to install the client, the Linux setup guide covers that first.

Why a terminal and a browser can disagree

A command-line tool such as curl is simple. It asks the system resolver to turn a name into an address, looks up the route in the kernel routing table, and opens a connection. If the VPN has changed the routes and the resolver, curl follows. That makes it an honest test of the basic tunnel.

A modern browser is a small operating system of its own. It brings extra behaviour that sits on top of, or beside, what the system does:

  • Its own DNS. Firefox and Chromium-based browsers can use DNS over HTTPS, sending name lookups to a chosen server inside an encrypted web request instead of using the system resolver. See DNS over HTTPS for the standard behind it.
  • Its own proxy rules. A browser may read a system proxy, a proxy auto-configuration file, or a manual setting, while curl follows only environment variables.
  • IPv6 first. Browsers try IPv6 eagerly when a site publishes an address for it. If the tunnel handles only IPv4, the IPv6 attempt can stall.
  • QUIC and HTTP/3. Many sites are reached over QUIC, which runs on UDP. Some networks and tunnels treat UDP differently from TCP.
  • Sandboxing. Flatpak and Snap packages run with restricted access and sometimes with their own network settings.
  • Extensions and cached state. Content blockers, per-site permissions and old cached answers can all produce a failure that never touches the tunnel.

Because each of these is a separate layer, the fix is not to reconnect the VPN again and again. The fix is to find the layer that fails and look at it directly.

Step 1: confirm what the terminal is really proving

Before blaming the browser, make sure the terminal test is meaningful. Run these three commands with the VPN connected.

  1. curl -sS -o /dev/null -w "%{http_code} %{remote_ip}\n" https://example.com shows the HTTP status and the address that curl actually connected to.
  2. curl -4 -sS -o /dev/null -w "%{http_code}\n" https://example.com forces IPv4.
  3. curl -6 -sS -o /dev/null -w "%{http_code}\n" https://example.com forces IPv6.

Three outcomes are common. If all three return a status, the system path is healthy and you should look inside the browser. If the IPv4 request works and the IPv6 request hangs or fails, you have found a very likely suspect, and you can jump ahead to the IPv6 section. If everything fails in the terminal too, then the browser is not the problem and you should follow the general guides for a VPN that is not connecting or a connection with no internet instead.

One more detail matters. Environment variables such as http_proxy and https_proxy change what curl does. Run env | grep -i proxy to see whether any are set. If they are, your terminal test may be using a proxy that the browser is not using, or the other way round, and that alone can explain the difference.

Step 2: test the name and the address separately

DNS is the most common cause, so separate it from everything else. Choose a site and find its address from the terminal:

getent hosts example.com

Then try the address directly in the browser, written as https://93.184.216.34 or whatever address came back. Many sites will show a certificate warning or a default page when reached by address, and that is fine for this test. What you want to see is whether the browser can open a connection at all.

  • If the browser reaches the address but fails on the name, the browser's name lookup is the problem. Go to the DNS over HTTPS section.
  • If the browser fails on both the name and the address, DNS is not the main cause. Go to the proxy, IPv6 and QUIC sections.
  • If the browser works on the name but only after a long delay, suspect IPv6 falling back to IPv4, or a slow resolver.

A common wrong conclusion is to treat every "site can't be reached" message as the same thing. Browsers print different errors for different failures. A name-not-resolved message points to DNS. A connection-timed-out message points to routing, IPv6 or a firewall. A connection-reset message often points to a proxy or to QUIC. Reading the exact wording saves time.

Cause 1: the browser uses its own DNS

Firefox and Chromium-based browsers can be set to use DNS over HTTPS. When it is on, the browser sends its name lookups straight to a configured server over HTTPS and never asks the system resolver at all. That has two consequences while a VPN is active.

First, a VPN that sets a DNS server for the tunnel cannot influence a browser that has decided to use something else. The browser's lookups may leave through the tunnel, because they are ordinary HTTPS traffic, but they go to the browser's chosen server, not the one the VPN suggested. Second, if the browser's chosen server is unreachable or filtered from where you are, the browser fails to resolve names even though the terminal, which uses the system resolver, is fine.

To test it:

  1. Open the browser's settings and search for "DNS" or "secure DNS".
  2. Set the option to use the operating system's resolver, or switch it off for the test.
  3. Restart the browser fully, then load the failing site again.

If that fixes it, you have your answer. You can then decide on purpose which resolver you want. The article on how browsers and VPNs handle DNS explains the trade-offs, and the Linux DNS leak guide shows how to check which resolver is answering at the system level, including resolvectl status and resolvectl query.

Cause 2: proxy settings differ between the two

Terminals and browsers do not read proxy settings the same way. curl, git and apt look at environment variables and their own configuration files. A browser may follow the desktop's network settings, a proxy auto-configuration script, or its own manual setting. If one of these points at a proxy that is no longer reachable once the VPN is up, the browser fails while the terminal succeeds.

Check each place in turn:

  • Run env | grep -i proxy and cat /etc/environment for system-wide variables.
  • In the desktop's network settings, look at the proxy section for the active connection.
  • In the browser, open the network or proxy settings and see whether it is set to use the system settings, a manual proxy, or an auto-configuration address.

For a quick test, choose "no proxy" in the browser and reload. If a work or school network requires a proxy for normal access, do not remove it permanently; you may lose access you are supposed to have. In that case the right question for the network administrator is whether the proxy and the VPN are meant to be used together. The article on Chrome proxy settings versus a VPN describes how the two interact in a browser.

Cause 3: IPv6 is not covered by the tunnel

Browsers use a technique often called happy eyeballs: they try IPv6 and IPv4 and use whichever answers first, with a slight preference for IPv6. That works well on a normal network. On a tunnel that carries only IPv4, an IPv6 attempt can leave through the physical interface outside the tunnel, or be dropped, and the browser may wait before it falls back. The user sees a slow or stuck page while curl -4 is instant.

You can recognise it from the earlier test: curl -4 works and curl -6 stalls or fails. You can confirm further with ip -6 route to see which interface carries the default IPv6 route. If it is the physical interface and not the VPN, IPv6 traffic is bypassing the tunnel. That matters for privacy as well as for page loading.

What you can do depends on your setup:

  • Disable IPv6 on the active connection in NetworkManager, or temporarily with sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1, as a test. Reverse it afterwards by setting the value back to 0.
  • If the VPN supports IPv6, check that its IPv6 route and DNS are active. If you are unsure what the app supports, ask support rather than guessing.
  • Read the article on websites that work on IPv4 but fail on IPv6 with a VPN for a longer walk-through.

Disabling IPv6 is a diagnostic step and a temporary measure, not a permanent recommendation. Some networks rely on it, and removing it can break other things.

Cause 4: QUIC and UDP behave differently from TCP

Many large sites support HTTP/3, which runs on QUIC over UDP port 443. Chromium-based browsers and Firefox use it when a site advertises it. The terminal command curl normally uses TCP unless it was built with HTTP/3 support and told to use it. So a page can work in curl and stall in the browser if UDP is filtered, limited or mishandled somewhere on the path, including on the network you are connecting from.

The browser is designed to fall back to TCP when QUIC fails, but the fallback can take a noticeable pause, and in some cases it does not recover cleanly. To test, you can disable QUIC for one session:

  • In Chromium-based browsers, open the experimental flags page and set the QUIC option to disabled, then relaunch. Flag names change between versions, so search the page for "QUIC".
  • In Firefox, the HTTP/3 setting lives in the advanced configuration page, and its name has changed over time, so search for "http3".

If disabling QUIC makes the page load instantly, the cause is the UDP path. Leave QUIC off only while you investigate. The standard itself, described in RFC 9000, is a legitimate and widely used transport, and the better long-term fix is to find out why UDP is being disturbed rather than to turn the feature off for good.

Cause 5: sandboxed browsers and local differences

On distributions that offer browsers as Flatpak or Snap packages, the browser may live in a confined environment. Confinement can change how it sees network configuration, proxy settings, certificates and local resolvers. A result is that a system-wide change you made, such as a VPN setting or a custom resolver on a local address, does not behave the same way inside the sandbox.

If you have more than one copy of the browser installed, compare them. Try the same site in a browser from your distribution's package manager and one from a sandboxed package. If only one fails, the cause is the packaging or its permissions, not the VPN. Check the package's permission settings for network and for access to system configuration, and look at its documentation for known limits with local DNS or custom proxies.

Also rule out the simple local factors:

  • Open a private window, which disables most extensions, and test again.
  • Create a fresh browser profile and test there. A damaged profile can keep stale settings.
  • Clear the DNS cache inside the browser if it has one, and restart it.
  • Make sure the system clock is correct, since wrong time makes secure connections fail in ways that look like network trouble.

A short decision table

What you see Most likely layer First thing to try
Name-not-resolved in browser, getent hosts works Browser DNS over HTTPS Set the browser to use the system resolver
Timed out in browser, curl -4 works, curl -6 hangs IPv6 outside the tunnel Test with IPv6 disabled on the connection
Connection reset, works with "no proxy" Proxy settings Compare browser and environment proxy settings
Slow first load, then fine QUIC fallback or IPv6 fallback Test with QUIC disabled and with IPv6 disabled
Works in system browser, fails in Flatpak or Snap one Sandboxing Compare packages and check permissions
Fails in terminal too Tunnel or routing Follow the general connection guides

A plain example

Suppose you are on a Linux laptop at a rented flat, with the VPN connected. curl https://example.com returns a page, but Firefox shows "Hmm, we're having trouble finding that site". You run getent hosts example.com and get an address, which tells you the system resolver is fine. You open Firefox settings, search for DNS, and find that DNS over HTTPS is on and pointing at a server you chose months ago. You switch it to use the system resolver, restart Firefox, and the page loads.

Nothing about the VPN was broken. The browser had simply been asking someone else for names. Notice what the example did not need: no reinstalling, no reconnecting in a loop, and no change to the tunnel. It needed one command to establish that the system worked and one setting to change.

A second, shorter case: the page loads in curl but Chromium hangs for ten seconds and then loads. curl -6 hangs while curl -4 is instant. The cause is the IPv6 attempt before fallback. Disabling IPv6 on that connection removes the delay, and you now know to look at how the VPN handles IPv6 instead of blaming the browser.

Limits and things to watch for

Commands and menu names vary between distributions and browser versions, so treat the steps here as a method rather than a script. Some points deserve extra care.

  • Do not leave protective settings off. Turning off secure DNS, IPv6 or QUIC to test is reasonable. Leaving them off without understanding why can reduce privacy or break other services. Write down what you changed and restore it.
  • A VPN does not guarantee anything. It can change the route your traffic takes and who sees it at the network level. It does not promise anonymity, security or access to every site, and a browser can still reveal information through accounts, cookies and fingerprinting.
  • Managed devices follow their own rules. If a computer belongs to an employer or school, proxy and DNS settings may be set deliberately. Ask the administrator before changing them.
  • Sites may block VPN traffic. If only one site fails and every other site works, the site itself may be rejecting the connection. That is a separate problem from the layers described above, and it usually needs the site's own support rather than a change on your side.
  • Keep the app's defaults. If the VPN app shows technical options, leave them at their defaults unless support suggests a change.

If you work through the layers and still cannot find the cause, collect the output of the commands above, the exact browser error text, your distribution and browser versions, and contact support. That is far more useful than a general description such as "the browser does not work".

Summary

When a VPN works in Linux terminal tools but not in a browser, the tunnel is usually healthy and the browser is using a different path. Check DNS over HTTPS, proxy settings, IPv6, QUIC and sandboxing in that order, using the same site by name and by address to narrow it down. Change one thing at a time, restore what you changed, and remember that no VPN guarantees access or privacy on its own. If you want a time-limited pass to test on your own Linux machine, you can see the options on the XPASS pricing page.

Frequently asked questions

Why does curl work through the VPN when my browser does not?

curl uses the operating system's resolver and routing table and nothing else, so it shows that the tunnel carries traffic. A browser adds its own layers: it may ask a DNS-over-HTTPS server directly, use proxy settings, prefer IPv6, try QUIC over UDP, or run inside a sandbox with a different view of the network. Any one of those can fail while the tunnel itself is healthy.

How can I tell whether the problem is DNS or routing?

Try the same site by name and by address. If curl to the address works and the browser shows a name-not-resolved error, the problem is DNS. If both the name and the address fail only in the browser, look at proxy settings, IPv6 or QUIC instead.

Should I turn off DNS over HTTPS in the browser?

Only as a test. Switching it to the operating system's setting is a fair way to see whether the browser's own resolver is the cause. Afterwards you can decide whether you prefer the browser's resolver or the system one, as long as you know which one is answering.

Does a Flatpak or Snap browser behave differently from a normal one?

It can. Sandboxed packages may have their own network permissions, proxy handling and DNS paths. If a browser installed from your distribution's repository works but the sandboxed one does not, compare the two before changing VPN settings.

Will changing browser settings make me less safe?

Testing a setting is not a security change by itself, but be careful about leaving a protective feature off. A VPN does not guarantee security or anonymity, so note what you changed and restore it once you know the cause.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need a VPN for a short trip or a busy month?

XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.

See passes

Keep reading

Device Guides

How to Test and Fix DNS Leaks on Linux

Linux has several layers that decide where DNS questions go. Learn to test which one is answering while your VPN is up, and how to fix it on systemd-resolved, NetworkManager and plain resolv.conf.

9 min read

Device Guides

Browser Secure DNS and VPN: How They Interact

Your browser can send its own encrypted DNS lookups, separate from the VPN. Here is what each combination means and how to choose settings that agree.

9 min read

Device Guides

Linux VPN Routing Tables Explained

A VPN on Linux is mostly a set of routing decisions. Learn to read ip route, understand the half-default trick and policy tables, and diagnose why traffic goes the wrong way.

9 min read