How Do You Separate a Linux DNS Problem from a VPN Tunnel Problem?
When pages stop loading on Linux with a VPN connected, the cause is either the tunnel or name resolution. A short sequence of commands tells you which one, so you fix the right layer.
10 min readUpdated Nov 11, 2026By XPASS Editorial Team

You connect the VPN on your Linux machine, the client says it is connected, and then nothing loads. The browser shows a spinner or a message about a server that cannot be found. It is tempting to blame the VPN, restart it a few times and hope. But "pages will not load" has two quite different causes that look the same from the outside: the tunnel is not carrying packets, or the tunnel is fine and the system cannot turn names into addresses.
This article gives you a short, repeatable sequence of checks that separates the two. You need only a terminal and a few built-in commands. The aim is not to teach every Linux networking tool but to answer one question quickly: is this a tunnel problem or a DNS problem? Once you know, you can read the more detailed article on Linux DNS leaks or the one on DNS not working with a VPN, instead of trying every fix at random.
Two layers that fail in different ways
A VPN tunnel and DNS are two separate pieces of the connection, and it helps to picture them as such.
- The tunnel is a virtual network interface that carries your packets to the VPN server. It works with IP addresses only. It does not know or care what a website is called. If it is broken, nothing travels, whether you type a name or a number.
- DNS is the lookup step that happens before a connection. When you open example.com, your system first asks a DNS server for the matching IP address. Only then does it send packets to that address, and those packets use the tunnel. If lookup fails, the tunnel is never even asked to carry the page. The general idea is covered in how DNS works.
The practical consequence is a clean test. Anything that uses a raw IP address skips DNS and tests the tunnel and routing alone. Anything that uses a name tests DNS first and the tunnel second. Comparing the two results tells you where to look.

Step 1: confirm the VPN interface exists
Start with the basics, with the VPN connected.
- Run
ip -brief addr. You should see an extra interface besides your Wi-Fi or Ethernet device. Its name depends on the client, for exampletun0,wg0or something custom. It should have an address and show stateUPorUNKNOWN. The word UNKNOWN is normal for many virtual interfaces. - If there is no extra interface at all, the client did not create the tunnel, and the problem is the connection itself. Check that the client shows connected and work through the connection steps in the Help Center. DNS is not your issue yet.
- Run
ip route. Look for a default route. With a full tunnel you normally expect the default route, or a pair of routes that together cover everything, to point at the VPN interface. If it still points only at your normal gateway, your traffic is not going through the tunnel.
If the interface exists and routes look sensible, move on. If you are not sure how to read the routes, the article on Linux VPN routing explains what to expect.
Step 2: test with IP addresses, which skips DNS
Now test the tunnel without involving names at all.
- Run
ping -c 4 1.1.1.1. This sends four small packets to a well-known public address. Replies mean packets are leaving your machine and coming back. - Run
ip route get 1.1.1.1. The output names the interface the kernel will use. With a full tunnel you expect the VPN interface. If it names your Wi-Fi or Ethernet device, the traffic is bypassing the tunnel, which may be intended if you configured split tunnelling, or may be a routing mistake. - If ping is blocked on your network, try a different check such as
curl -I https://1.1.1.1ornc -vz 1.1.1.1 443. Some networks and servers drop ping on purpose, so a missing ping reply alone is not proof of a dead tunnel. Treat a success as useful and a failure as a reason to try one more method before concluding anything.
Interpret the result carefully.
- Replies come back: the tunnel and routing are passing traffic. The problem is likely DNS, or a size issue covered later.
- No replies and no route through the VPN interface: this is a tunnel or routing problem. Reconnect, check the client, and review the routes.
- No replies, but routes look right: the tunnel may be up in name only. A stale session, a blocked port on the current network, or a server that is not responding are all possible. Try a different network or reconnect.
Step 3: test with names, which includes DNS
Next, repeat the test using a hostname.
- Run
ping -c 4 example.com. If the name resolves, you will see the IP address in the first line of output. If you see "Temporary failure in name resolution" or "Name or service not known", DNS failed. - Run
getent hosts example.com. This asks the same resolver path that most programs use, so it is a better model of what your browser sees than some specialised tools. - Compare. If step 2 succeeded with an IP address and this step failed, you have a DNS problem. The tunnel is carrying traffic, but names cannot be turned into addresses.
This single comparison solves a large share of cases. It is worth running before any other troubleshooting, and it takes about thirty seconds.
Step 4: find out which resolver your system is asking
When DNS fails, you want to know which server is being asked and whether it can be reached. On a system with systemd-resolved, which includes many desktop distributions, use these commands.
- Run
resolvectl status. For each link you will see the DNS servers, search domains and whether it is the default route for DNS. Check the VPN link and your physical link. Note any server that looks like a private address such as 192.168.1.1, because that is usually your home router and may not be reachable once the tunnel changes your routes. - Run
resolvectl query example.com. The output includes which link answered, or an error that tells you why it failed. A timeout means the chosen server did not reply at all. An answer that mentions a different interface than you expected tells you the query is taking a different path from your web traffic. - Run
cat /etc/resolv.conf. A linenameserver 127.0.0.53means systemd-resolved is the local stub. Other systems may list a real server here.
If your system does not use systemd-resolved, resolvectl will say so. In that case read the nameserver lines in /etc/resolv.conf and check NetworkManager with nmcli device show for the DNS entries on each device.
Ask a specific server directly
If dig is installed, you can bypass the system's choice and ask one server yourself. This separates "the server is bad" from "my system is asking the wrong place".
dig example.com @1.1.1.1asks a public resolver by IP. If this works while normal lookups fail, the tunnel is fine and the problem is which server your system is configured to use.dig example.com @SERVER_ADDRESSasks the exact server your system chose. If this times out, that server cannot be reached from where you are, often because it sits on a network your current routes no longer cover.
If dig is missing, nslookup example.com 1.1.1.1 does a similar job. Both use plain DNS to the address you name, so a firewall that blocks port 53 outbound will block them too.
Step 5: read the pattern
Putting the results together gives a clear picture. This table summarises the common patterns.
| IP ping | Name lookup | What it points to | First thing to try |
|---|---|---|---|
| Works | Works | Tunnel and DNS both pass; fault is elsewhere | Test the specific site or app, check MTU |
| Works | Fails | DNS problem | Check which resolver is set for the VPN link |
| Fails | Fails | Tunnel or routing problem | Reconnect, check routes, try another network |
| Fails | Works | Unusual; ping may be blocked | Use curl or nc for the IP test instead |
| Works, but pages stall | Works | Possible packet size (MTU) problem | Test with smaller packets |
The fourth row is rare but real. Some networks filter ICMP echo, which is the type of packet ping sends, so a missing reply does not prove the tunnel is dead. That is why Step 2 offers curl and nc as alternatives.
A worked example
Suppose you are at a cafe, you connect the VPN, and a browser tab fails with "server not found".
You open a terminal. ip -brief addr shows the VPN interface with an address, so the tunnel exists. ping -c 4 1.1.1.1 returns replies, so packets travel. ip route get 1.1.1.1 names the VPN interface, so routing is correct.
Now ping -c 4 example.com reports "Temporary failure in name resolution". The tunnel works and DNS does not. resolvectl status shows the VPN link has no DNS server of its own, while the Wi-Fi link lists the cafe router at 192.168.50.1 as its DNS and is marked as the default for lookups. dig example.com @192.168.50.1 times out, since that address is on the cafe network and the new routes no longer reach it the way they did before.
You now know exactly what is wrong: the system is still asking a resolver it can no longer reach. The fix is about DNS settings, such as giving the VPN link a reachable DNS server or making it the default for lookups, and not about reconnecting the tunnel ten more times. The detailed steps are in the Linux DNS leak article linked at the top, which covers systemd-resolved, NetworkManager and plain resolv.conf.

Cases that mix both layers
Not every fault is a clean either/or. A few situations deserve a separate mention.
Names work, IPs work, but pages stall
If both tests pass but a site loads partly or hangs, suspect packet size. A tunnel adds overhead, so the largest packet it can carry is a little smaller than on a plain connection. If the path does not handle this gracefully, small packets such as DNS answers and pings succeed while larger page data stalls. You can test with ping -c 4 -M do -s 1300 1.1.1.1 and raise or lower the size to see where replies stop. The idea behind it is described in Path MTU Discovery. This is a tunnel-side symptom even though DNS looks healthy.
IPv6 and IPv4 disagree
Your system may receive both IPv4 and IPv6 addresses for a site. If the tunnel carries only IPv4 and the system prefers IPv6, a site can appear to hang because the IPv6 attempt goes nowhere before IPv4 is tried. Compare ping -4 example.com with ping -6 example.com. If only one works, the problem is that protocol path, not DNS in general.
Only some names fail
If most sites load but internal or local names fail, you may be looking at split DNS, where different names are meant to be answered by different servers. That is a configuration question rather than a broken tunnel.
It fails only on this network
If the same VPN works on a phone hotspot but not on the cafe Wi-Fi, the local network may block or rewrite part of the traffic. Captive portals, which ask you to accept terms in a browser, can also stop DNS and traffic until you complete them. Open the portal page first, then connect the VPN.
What this method cannot tell you
These checks narrow the cause but they have limits, and it is better to know them.
- A passing test is a snapshot. Networks change, and a lookup that worked a minute ago can fail now.
- A ping success does not prove that every protocol or port is open. Some networks allow ping and block other traffic.
- The tests show where the symptom appears, not why. "The resolver is unreachable" is a finding, but the underlying reason may be a client setting, a network manager rule or the network you are on.
- Commands differ between distributions. If a tool is missing, install it from your package manager or use the alternative named above.
- Nothing here changes what a VPN can do. A VPN does not guarantee that every site will load, and it cannot fix a problem on the website's side or a fault in your internet connection.
Also remember that a VPN client for Linux is a desktop tool. VPNclient supports 64-bit Intel and AMD desktops with systemd, and not ARM, so if you are on a different kind of device your options differ.
What to do next
Match the finding to a next step.
- DNS fails, tunnel passes: follow the DNS-specific guidance in the two DNS articles linked in the introduction. Typical actions are setting a reachable DNS server for the VPN link and checking that the resolver is not pointing at an unreachable address.
- Tunnel fails: reconnect once, check the routes, and try a different network. Read the Linux setup guide to confirm the install steps were completed, including the executable permission and administrator password.
- Both pass but pages stall: test the packet size idea above.
- Still unclear: write down which tests passed and failed, your distribution, and the time, then contact support. Never include your VPN username or password in the message.
Keep the order of the tests. Interface first, IP second, name third, resolver fourth. Skipping ahead is how people end up changing DNS settings when the tunnel was the issue, or reinstalling a client when only a resolver entry was wrong.
Summary
When a Linux machine will not load pages with a VPN on, the fastest way to separate the tunnel from DNS is to test an IP address first and a hostname second. If the IP answers and the name does not, look at DNS and which resolver your system is asking. If neither answers, look at the interface, the routes and the network you are on. Packet size and IPv6 are the usual in-between cases. If you want a pass you can set up and test on your own schedule, you can look at the XPASS pricing page and check the Help Center when a step is unclear.
Frequently asked questions
What is the fastest way to tell DNS from the tunnel?
Ping a public IP address such as 1.1.1.1, then ping a hostname such as example.com. If the IP address answers but the name does not, the tunnel carries traffic and the fault is in name resolution. If neither answers, look at the tunnel and routing first.
If ping to an IP works, is the VPN definitely fine?
Not definitely. A ping is a tiny packet. Large packets can still fail when the path allows only smaller ones, so pages may stall even though ping succeeds. It does show that the tunnel is passing at least some traffic.
Can DNS fail only while the VPN is connected?
Yes. A VPN client or network manager may change which DNS server your system uses. If the new server is unreachable, or the resolver still points at an address that no longer works, names fail while the VPN is on and recover when it is off.
Does it matter which Linux distribution I use?
It matters for which commands exist. Many desktop distributions use systemd-resolved, where resolvectl is the right tool. Others use NetworkManager with dnsmasq or a plain resolv.conf file. The ping and ip route tests work everywhere.
What should I send to support if I cannot find the cause?
Note which test failed, for example IP ping works but name lookup fails, plus the distribution name, whether you use systemd-resolved, and the time it happened. Do not paste your VPN username or password into any message.
References
About the author

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 passesKeep 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

Troubleshooting
DNS Not Working When VPN Is Connected
When the VPN says connected but pages fail with name errors, DNS is the usual suspect. Here is how to prove it, why it happens and what to change on each device.
9 min read

VPN Basics
How DNS Works: From Domain Name to IP Address
DNS is the lookup system that turns a website name into the IP address your device actually connects to. Here is how a lookup works, step by step, and why it matters for privacy.
9 min read