How Can You Compare DNS Response Times With and Without a VPN?
DNS lookup time is a small slice of page load time, but it is easy to measure badly. This guide shows a fair side-by-side test and how to read the numbers.
10 min readUpdated Nov 4, 2026By XPASS Editorial Team

When a website feels slow, DNS is one of the first suspects, and a VPN is one of the first things people blame. It is a reasonable instinct, because every page load starts with a DNS lookup, and turning a VPN on changes the path that lookup takes. But the instinct is hard to confirm. Run a lookup once, turn the VPN on, run it again, and you will often see numbers that are confusing or even contradictory.
This article shows a fair way to compare DNS response times with and without a VPN. You will see why the obvious test is misleading, which commands to use on each system, how to deal with caching and resolvers, and how to read the result without over-promising what a few milliseconds mean. It is general educational information, and the numbers on your own connection will differ from anyone else's.
What you are actually measuring
A DNS lookup is the question "what is the IP address of this name?" The Cloudflare explainer on DNS gives a plain overview, and our article on how DNS works walks through the full chain. For timing purposes, three pieces matter:
- The trip to the resolver. Your device sends the question to a resolver, which is a server that answers on your behalf. Without a VPN this is usually the resolver assigned by your router or mobile network. With a VPN it is normally a resolver that the VPN setup provides, reached through the encrypted tunnel.
- The resolver's own work. If the resolver already holds the answer in its cache, it replies immediately. If not, it asks other servers, which takes longer.
- The trip back. The answer returns along the same path.
The number printed by tools such as dig is the time between sending the question and receiving the answer. It is a form of latency, the same idea explained in the Cloudflare piece on latency. It does not include everything that makes a page slow, such as connecting to the website, downloading images or running scripts. DNS is usually a small slice of a page load, which is why a measurable DNS difference does not always feel like a difference in real use.

Why the obvious test misleads
The obvious test is to run one lookup without a VPN, connect, run one more, and compare. Several things quietly spoil it.
- Caching. After the first lookup of a name, your device, your router or the resolver may remember the answer. The second lookup then returns in a millisecond or two. If the first run was without the VPN and the second was with it, the VPN may look faster for no real reason.
- A single sample. DNS times vary from one lookup to the next. One measurement is an anecdote. A handful is closer to evidence.
- Different names. Popular domains are often cached by large resolvers, while a rarely visited domain is not. Comparing different names across the two runs compares the names, not the network.
- Different moments. Congestion and Wi-Fi quality change minute to minute. If the two runs are far apart in time, the network itself may have changed.
- A different resolver set by hand. If you pointed one run at a specific resolver with the @ option, and the other run uses the system default, you are comparing two resolvers, not two paths.
The fix is a simple discipline: same names, same tool, same device, close in time, several runs, and a clear separation between cached and uncached answers.
A fair test, step by step
Choose five to eight domain names that you actually use, such as a news site, a shopping site, a work tool and a video service. Write them down so both rounds use exactly the same list. Stay on one network and one device, and avoid downloads or streaming while you test.
Round 1: without the VPN
- Disconnect the VPN and confirm it is off.
- For each name, run a lookup and note the time. Do this once for the first (cold) result.
- Run each name two more times and note them separately as the warm results.
- If you want a tidier cold result, wait a few minutes between names, or use names you have not visited recently.
Round 2: with the VPN
- Connect the VPN and wait until the app shows it as connected.
- Repeat the same names in the same order, noting cold and warm results the same way.
- Keep the same tool and options as in round 1.
Commands for each system
On macOS and Linux, open a terminal and use dig, which prints a line such as "Query time: 28 msec":
dig example.com
dig example.com | grep "Query time"
If dig is not installed, many Linux systems offer it in a package often called dnsutils or bind-utils. On Windows, PowerShell can give a rough figure:
Measure-Command { Resolve-DnsName example.com -DnsOnly }
The result in the TotalMilliseconds line includes some PowerShell overhead, so treat it as a rough comparison only, as long as you use it for both rounds. A basic check also works with nslookup example.com, although nslookup does not print a neat timing line by default. On phones, the easiest route is a trusted network-diagnostic app that reports lookup time, or simply to rely on the desktop test, since the VPN path is similar in principle.
Separate cold and warm results
Cold and warm results answer different questions.
- Cold lookups show how long it takes when the resolver must work. They are closest to what you feel the first time you visit a site in a while.
- Warm lookups show the cost of just reaching the resolver. They are close to the pure round trip, similar to a ping to that resolver.
A useful way to record the results is a small table. Here is a plain example with invented numbers, only to show the layout:
| Name | No VPN, cold | No VPN, warm | VPN, cold | VPN, warm |
|---|---|---|---|---|
| news site | 38 ms | 12 ms | 61 ms | 34 ms |
| shop site | 45 ms | 13 ms | 58 ms | 35 ms |
| video service | 33 ms | 11 ms | 64 ms | 36 ms |
| work tool | 52 ms | 14 ms | 70 ms | 38 ms |
In this made-up example the warm VPN numbers are about 22 ms higher, which would hint at the extra trip through the tunnel. The cold numbers rise by a similar amount. That pattern is common to expect, but it is not a rule: your own table may show the VPN resolver faster, especially if your normal resolver is slow.
Take the median of the three runs for each cell instead of the single best or worst number. The median is less distorted by one odd spike.
Reading the result without over-reading it
Once you have the table, a few interpretations are reasonable and a few are not.
Reasonable:
- A consistently higher warm time with the VPN usually reflects the added distance of the tunnel path. The farther the VPN location is from you, the more this tends to show, which is also why our guide to benchmarking VPN latency fairly suggests testing several locations.
- A lower cold time with the VPN can mean the VPN's resolver is better connected or better cached than the one your network assigns. Some home and mobile resolvers are simply slow.
- A big gap between cold and warm times on both sides suggests caching is doing most of the work, and that real-world speed depends on whether you have visited a site recently.
Not reasonable:
- Concluding that the VPN is "slow" because DNS is 20 ms higher. A page load is typically measured in hundreds of milliseconds to seconds, and the DNS lookup happens once per name, often cached afterwards.
- Concluding that the VPN is "fast" from a single lucky result.
- Treating a timing difference as proof of privacy or of a leak. Speed and privacy are separate questions.
Resolvers, the part that changes between runs
When the VPN connects, your device may change which resolver it asks. That is often the biggest source of difference, bigger than the tunnel itself. Three situations are common:
- The VPN supplies its own resolver. Lookups go through the tunnel to that resolver. Timing then reflects the tunnel plus that resolver's speed and cache.
- Your device keeps using the network resolver for some lookups. Some systems send certain lookups outside the tunnel, or send them to several resolvers at once. This can make timing look odd and can also be a privacy issue. Our article on what a DNS leak is explains the risk and how to check for it.
- A browser uses its own encrypted DNS setting. Some browsers can resolve names through their own DNS over HTTPS service, independent of the system and sometimes of the VPN. If a browser is doing that, a command-line test and a real page load can follow different paths. The article on VPN and DNS security covers who can see lookups in each case.
You do not need to dig into these to run the timing test, but you should know them if the numbers look inconsistent. If one run behaves very differently from what you expected, check which resolver answered. In dig, the SERVER line near the end of the output shows the address of the resolver used.

Common mistakes and how to avoid them
- Testing right after connecting. Give the VPN a few seconds to finish setting up, otherwise the first lookups may time out or take an unusual route.
- Changing locations between runs. Pick one VPN location for the whole comparison. If you want to compare locations, do it as a separate test.
- Mixing Wi-Fi and mobile data. Test on the same network for both rounds.
- Forgetting background traffic. Cloud backups, updates and streaming compete for bandwidth and can distort timing.
- Reading one timeout as a failure. A rare timeout is noise. A repeated timeout deserves attention.
- Comparing resolvers when you meant to compare paths. Keep the system default in both rounds unless you are deliberately testing a specific resolver.
If timeouts keep happening only with the VPN on, check that your device is not also trying to use another resolver, and try a different VPN location. Persistent trouble can be raised with support, together with your timing table, which is far more useful than "it feels slow".
Limits of this test
A DNS timing test is useful, but it has real limits, and it is honest to say so.
- It measures only one step. Page speed also depends on the connection to the website, the size of the page and your device. Total browsing speed is a wider topic than DNS alone.
- It is a snapshot. The numbers will move with time of day, network load and the VPN location you choose.
- It cannot prove privacy. A lookup that is quick may still go to a place you did not intend. Use a dedicated leak test for that question.
- It says nothing about guarantees. A VPN does not guarantee faster or slower browsing, and no test makes it a promise. The result describes your connection on one occasion.
- Tools differ. dig, nslookup and PowerShell measure slightly differently, so only compare numbers taken with the same tool.
Summary
To compare DNS response times fairly, use the same list of names, the same tool and the same device, run several lookups close together, and keep cold and warm results apart. Take medians, change only one thing at a time (the VPN being on or off), and remember that the resolver your device uses may change when the VPN connects, which often matters more than the tunnel itself. Read a difference of a few milliseconds as a clue about the path, not as a verdict on the VPN, and use a separate leak test if the question is privacy rather than speed. If you want a pass to run this comparison on your own connection, you can look at the options on the pricing page.
Frequently asked questions
Does a VPN make DNS lookups slower?
Often a little, because the question now travels through the tunnel to the VPN's resolver before an answer returns. But the VPN's resolver may be faster or better cached than the one your home or mobile network assigns, so the result can go either way. Measure on your own connection instead of assuming.
Why is my second DNS lookup much faster than the first?
Resolvers and devices keep recent answers in a cache. The first lookup may need to ask several servers, while the second is answered from memory. Compare first lookups with first lookups and cached with cached, otherwise the test is not fair.
Which command should I use to measure DNS time?
On macOS and Linux, dig prints the query time in milliseconds. On Windows, Resolve-DnsName inside Measure-Command in PowerShell gives a rough figure, and nslookup works for a simple check. Use the same tool for both the with-VPN and without-VPN runs.
Is a lower DNS time always better?
Not necessarily. A lookup that saves a few milliseconds is invisible next to page load time, and the fastest resolver may not be the one you want for privacy or reliability. Treat DNS time as one clue, not the final score.
Can DNS timing show whether my VPN is leaking DNS?
Not reliably. A timing difference hints that lookups took a different path, but only a proper leak test shows which resolver answered. Use the timing test for speed and a leak test for privacy.
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

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

VPN Security
How to Benchmark VPN Latency Fairly
A step-by-step method for measuring the extra delay a VPN adds, with a baseline, a test schedule, a results sheet and the mistakes that make latency numbers meaningless.
9 min read

Privacy Guides
VPN and DNS Security: What Is Protected?
Every website visit starts with a DNS question. This guide follows that question with and without a VPN, so you can see what is protected, what is not and how to test it.
9 min read