Can a Stale DNS Cache Make a VPN Location Look Incorrect?
Sometimes a site still behaves as if you were in your old location after you connect a VPN. A stale DNS cache can be one cause, though not the most common one. This guide shows how to tell and how to clear it.
10 min readUpdated Nov 4, 2026By XPASS Editorial Team

You connect a VPN, open a website that is supposed to show local content, and it behaves as if you had not moved. The prices are in the old currency, the language is the old language, or a "not available in your region" message appears. An IP lookup page, meanwhile, shows the VPN address you expected. It is natural to wonder whether something stored on your device is to blame, and a stale DNS cache is one of the first suspects.
The honest answer is that a stale DNS cache can sometimes play a part, but it is not the usual cause, and it works in a narrower way than most people assume. This guide explains what the DNS cache really stores, what it can and cannot change about where you appear to be, how to tell it apart from other causes, and how to clear it safely on each kind of device.
What the DNS cache stores
DNS is the system that turns a name such as example.com into the numeric address your device actually connects to. The basics are covered in how DNS works and in the original specifications, RFC 1034 and RFC 1035. Looking up a name takes a little time, so answers are stored for a while and reused. Each answer comes with a time-to-live value that tells everyone how long it may be kept.
Several places keep a copy:
- Your browser keeps its own short-lived list of recent lookups.
- Your operating system keeps another, shared by all apps on the device.
- Your router may cache answers for every device on your home network.
- The resolver you use, run by your internet provider, the VPN service or a public DNS provider, caches answers for many customers at once.
A cached answer is just a name paired with an address and an expiry time. It contains nothing about your location. What matters for this article is that the address in the answer may have been chosen for the place you were in when you asked.

How DNS can influence what you see
Many large websites use more than one server and try to send each visitor to a nearby one. Some do this by giving different DNS answers depending on where the question came from. A visitor in one country may be told to use one server, and a visitor in another country may be told to use a different one. Those servers may carry different regional versions of the site, or simply be in different data centres.
If you looked up the site on your normal network and the answer was cached, your device may keep using that address for the rest of the cache lifetime, even after you connect the VPN. For a few minutes, or occasionally longer, you could be talking to the server picked for your old location. That is the main way a stale DNS cache can make a location look incorrect: it affects which server you are sent to, not which address the server sees you coming from.
There is a second, related effect. The resolver that answers your questions is part of the picture. If your DNS questions still go to your normal provider while your other traffic goes through the VPN, the site may base its server choice on where the resolver is, not where you appear to be. That is a routing question rather than a cache question, and it is discussed in VPN and browser DNS.
What a stale cache cannot change
It helps to be clear about the limits, because it saves a lot of fruitless flushing.
- It does not change your public IP address. Once the VPN carries your traffic, websites see the address of the VPN server. Clearing or keeping the DNS cache does not alter that. If you want the background, see an explainer on public IP addresses.
- It does not change how a geolocation database labels that address. A site that looks up the VPN address in an out-of-date or disagreeing database will give a wrong city or country regardless of your cache. This is covered in why your VPN shows the wrong location and the GeoIP database guide.
- It does not change your browser's location permission, time zone or language. These are separate signals that a site can read.
- It does not reach into a site's account records. If your account is tied to a region, no cache clearing will change that.
So if an IP lookup page itself shows the wrong place, the cache is almost certainly not the cause. If the lookup page is right but a particular site still behaves as if you were elsewhere, a stale cache is one possibility among several.
Signs that a stale cache may be involved
Look for a pattern like this:
- The problem began right after you connected, disconnected or switched VPN locations.
- It affects one or two sites, not every site.
- A different browser or a private window behaves differently.
- The behaviour changes by itself after some minutes, as cached answers expire.
- Other devices on the same VPN, using the same website, behave correctly.
Points three and four are especially telling. Browser caches and operating system caches are separate, so a private window with no stored data will often reveal whether something local is involved. If the private window is correct and your normal window is not, cookies and stored site data are as likely as DNS to be the cause.
Step by step: a clean test
This sequence changes one thing at a time, so you can see what actually fixed the problem.
- Confirm the VPN is carrying your traffic. Open an IP lookup page and check that the address is not your usual one. If it still shows your normal address, fix the connection first. VPN DNS not working covers related symptoms.
- Open the problem site in a private window. If it now shows the right region, the cause is stored browser data. Clear cookies and site data for that site only.
- Clear the operating system DNS cache using the commands in the next section.
- Fully close and reopen the browser, not just the tab, so its own host cache is dropped.
- Reload the site and note whether the behaviour changed.
- Restart the VPN connection if nothing changed, then repeat steps three to five. Switching to another location and back can also give you a fresh start.
- Wait. If the cache entry expires within minutes, the site may correct itself without any action from you.
If the site still behaves the same after these steps, the cause is most likely elsewhere, such as the site's own location database, your account settings or the browser's location permission.
How to clear the DNS cache on each device
The exact steps depend on the system. These are standard commands from the operating systems themselves, though menus and command names can change between versions.
| Device | How to clear the DNS cache |
|---|---|
| Windows | Open Command Prompt and run ipconfig /flushdns. |
| macOS | In Terminal run sudo dscacheutil -flushcache, then sudo killall -HUP mDNSResponder. You will be asked for your Mac password. |
| Linux (systemd-resolved) | Run resolvectl flush-caches. Other setups use different tools, so check yours. |
| iPhone / iPad | Switch airplane mode on, wait a few seconds, then switch it off. Restarting the device also works. |
| Android | Switch airplane mode on and off, or restart. Clearing the browser's cache and data also removes its stored lookups. |
| Chrome / Edge | Closing the whole browser usually drops its cache. Some versions also offer an internal page to clear the host cache, though its address can change. |
| Home router | Restarting the router clears its cache. Do this only if you are comfortable with the brief outage. |
On a Mac, remember that the commands need administrator rights. On any device, avoid pasting commands from sources you do not trust, because a command run as administrator can change a lot.

A plain example
Mina travels for work and connects the VPN in her hotel room. She opens a retailer's site and sees prices in her home currency, even though she chose a location in another country. A lookup page shows the VPN address, so the tunnel is working.
She opens the retailer in a private window and still sees the home currency, so browser data is not the explanation. She flushes the operating system cache, closes the browser and reloads. Nothing changes. Ten minutes later, she notices that the prices have switched without her doing anything.
What most likely happened is that the retailer's server choice and regional settings were based on earlier lookups, and they changed once cached entries expired and the site re-evaluated the new address. She cannot be sure which step, if any, helped, which is a normal outcome. DNS caches expire on their own, and the site may also have updated its own view of her address in the meantime.
The lesson from the example is to treat clearing the cache as a cheap, low-risk step, not a guaranteed fix, and to work through the other possible causes instead of repeating the same step.
Other causes to rule out
When the cache turns out not to be the issue, these are the usual suspects:
- The site's geolocation database is out of date or labels the VPN address differently from other databases.
- Cookies and saved preferences record a region from an earlier visit.
- Account settings such as country, currency or app store region.
- Browser location permission, where the site asks the browser for a device location rather than relying on the address.
- Time zone and language settings on the device.
- A DNS or WebRTC leak that lets a site see something other than the VPN path. Read about DNS leaks if you suspect that.
- Streaming or banking policies that block VPN addresses regardless of location.
Working through these in order, starting with the cheapest to check, is quicker than guessing.
Limits and what to watch for
A few cautions keep expectations realistic.
First, a VPN does not guarantee that every site will treat you as being in the country you picked. Websites make their own decisions, use their own databases and may change their rules without notice. Clearing a cache cannot override that.
Second, do not use these steps to get around a service's terms or local rules. Regional restrictions often exist for licensing or legal reasons, and the rules of the site and the law where you are still apply. This guide is about fixing a technical mismatch, such as a map app or shop that has not noticed you are connected, not about defeating a restriction.
Third, flushing a cache is not a security measure. It will not repair a DNS leak, and it will not make you anonymous. If you want to check whether your lookups are leaving the VPN, use a proper leak test and read the basics of how DNS works first.
Finally, be careful with advice found online that tells you to change system files or install "DNS cleaner" tools. Standard commands from your operating system are enough, and extra software only adds risk.
Summary
A stale DNS cache can make a site seem to ignore your VPN location, but only in a limited way: it can keep you pointed at a server chosen for your old network, and it cannot change your IP address or how a database labels it. Confirm the VPN is carrying your traffic, test in a private window, clear the operating system and browser caches, reconnect, and give cached entries a few minutes to expire. If the problem remains, look at cookies, account settings and the site's own location data. If you would like a VPN pass to test these steps with, you can look at the options on the XPASS pricing page.
Frequently asked questions
Can a stale DNS cache change the country a website thinks I am in?
Not directly. A website decides your country mainly from the IP address of the connection it receives, and DNS caching does not change that address. A stale DNS cache can, however, send you to a server or regional version of a site that was chosen before you connected the VPN, which can look like a wrong location.
How do I clear the DNS cache after connecting a VPN?
On Windows run ipconfig /flushdns in a command prompt. On a Mac run sudo dscacheutil -flushcache followed by sudo killall -HUP mDNSResponder. On Linux with systemd-resolved run resolvectl flush-caches. On a phone, switching airplane mode on and off or restarting the device usually clears it. Also close and reopen your browser, because browsers keep their own cache.
Should I clear the cache before or after connecting the VPN?
After the VPN is connected is the safest order, so that new lookups are made on the VPN path. Clearing it again after you disconnect can also help when a site behaves oddly on your normal network.
How can I tell if the cause is DNS cache or the IP address database?
Open an IP lookup page in a private window. If it shows the VPN address but a particular site still behaves as if you were elsewhere, the cause is more likely cached data, cookies, or that site's own database. If the lookup page itself shows your old IP address, the VPN may not be carrying your traffic.
Does clearing the DNS cache make a VPN more private or secure?
No. It only removes stored lookup answers so that new ones are requested. It is a troubleshooting step, not a security feature, and it cannot fix a DNS leak.
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
Why Your VPN Shows the Wrong Location
When a site thinks you are in the wrong city or country while a VPN is on, the cause is usually the database behind the guess, not the VPN itself. This guide explains how location lookups work and how to check them.
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

VPN Security
How IP Geolocation Databases Affect VPN Locations
A VPN address is placed on the map by commercial databases, not by the VPN app. Learn how those databases work and why websites disagree about your location.
9 min read