Skip to content

Can a VPN Connection Fail Because Its Server Name Resolves to an Old Address?

If your VPN app stops connecting but the internet works, the server name may be resolving to an old address from a cache. This guide shows how to confirm it and clear each cache layer.

11 min readUpdated Nov 25, 2026By XPASS Editorial Team

Can a VPN Connection Fail Because Its Server Name Resolves to an Old Address?

You tap connect and the VPN app spins, then fails or times out. Other apps load fine, so the internet itself is working. One cause worth checking, though it is not the most common, is that the app is connecting by a server name and your device is turning that name into an address that is no longer correct. Names such as server.example.net are only labels. Before any VPN traffic can start, something has to translate the label into an IP address, and that answer can be stored, remembered and reused long after it stopped being true.

This article is about that narrow case: a connection that fails because a server name resolves to an old address. It explains where an old answer can hide, how to flush each cache on Windows, macOS, Linux and phones, what a router and the hosts file can do, how DNS TTL fits in, and how to compare answers with nslookup or dig. It does not claim to know how any particular provider names or rotates its servers. It teaches you how to check for yourself, then rule the idea in or out quickly.

How a server name becomes an address

Most VPN apps hold a server entry that contains a hostname rather than a fixed number, because names are easier to maintain than addresses. When you connect, the app asks the system to resolve that name. The system checks several places in order: a local override file, its own cache, and then the DNS resolver your network gave it, which is often your router or your internet provider's resolver. That resolver may answer from its own cache or ask other servers on the way. The general mechanism is described in how DNS works, and the formal definitions are in the DNS standards listed in the references below.

Each answer carries a time to live, or TTL, a number of seconds that says how long it may be kept. A site that moves a server to a new address will normally lower the TTL beforehand, change the record, and wait. But caches differ in how closely they obey the TTL, and some clients hold on longer than they should. That is the gap in which an old address survives.

If the name resolves to an address that has been retired, three things can happen. The connection attempt may hit nothing and time out. It may reach a machine that no longer runs the VPN service and be refused. Or, rarely, it may reach a machine that now belongs to someone else. In all of these cases the app shows a generic failure, because from its point of view it did what it was told.

Signs that point to a stale address

A stale answer is a suspect, not a diagnosis. These signs raise its likelihood:

  • The VPN worked yesterday, or worked on another network or device a minute ago, and now fails on this one.
  • The failure is a timeout rather than a wrong-password message.
  • Other devices on the same Wi-Fi connect, but one device does not. That points at a per-device cache or a hosts-file entry.
  • The failure began after the provider changed something, or after you restored a backup, changed routers or moved a configuration from an old device.
  • Connecting by mobile data works while home Wi-Fi fails. That points at the router or the resolver it uses.

Signs that point elsewhere include an authentication error, a message about an expired pass, or no internet at all. For the generic timeout pattern see VPN connection timeout.

Step 1: Compare what your device sees with a public resolver

Testing beats guessing. You need the exact server name the app is trying. If the app does not display it, do not guess a name; a made-up name tells you nothing. Support can tell you, or the connection log in the app may show it. Your My Pass page shows the setup details your pass uses, so check there for connection information that applies to you.

With the name in hand, ask your normal resolver and a public one, then compare.

On Windows, in Command Prompt:

nslookup server.example.net
nslookup server.example.net 1.1.1.1

On macOS or Linux, with dig:

dig +short server.example.net
dig +short server.example.net @1.1.1.1

Replace server.example.net with the real name. The second command in each pair queries a public resolver directly and skips your router's cache. The numbers are addresses.

How to read the result:

What you see Likely meaning
Both resolvers return the same address The DNS answer is probably not the problem. Look at the network path, credentials and server status
Your normal resolver returns a different address from the public one A cache, an override or a resolver difference. Continue with the steps below
Your normal resolver returns an error or nothing A resolver problem rather than a stale answer; see VPN DNS not working
The name resolves to a private-looking address such as 192.168.x.x A local override, such as a hosts entry or a router rule. See the sections below
Several addresses come back and they change between runs Normal for names that spread load. Not by itself a sign of a stale cache

Do not read too much into one difference. Large services often return different addresses depending on where the question comes from, so two resolvers disagreeing is a hint, not a verdict. The stronger test is whether the app connects after you clear the suspect layer.

Step 2: Flush the DNS cache on your device

The operating system keeps its own cache. Clearing it is safe: the cost is that the next lookups are slightly slower while the cache refills. Exact commands vary with version, so treat these as the usual ones.

System Typical command or action
Windows 10 and 11 Open Command Prompt as administrator and run ipconfig /flushdns
macOS In Terminal run sudo dscacheutil -flushcache and then sudo killall -HUP mDNSResponder
Linux with systemd-resolved resolvectl flush-caches (older setups use systemd-resolve --flush-caches)
Linux with other resolvers Restart the caching service you use, for example dnsmasq or nscd
iPhone and iPad Toggle airplane mode for ten seconds, or restart the device
Android Toggle airplane mode, or restart; some versions also clear it when you turn Wi-Fi off and on

On Windows you can confirm what is cached with ipconfig /displaydns, which lists remembered names and, in many versions, their remaining TTL. Look for your server name; if it is there with an old address, flushing should remove it.

After the flush, close the VPN app fully and reopen it, because some apps remember the address they resolved earlier in the session. Then try to connect. Note the time and any error text in case you need to contact support.

Browsers have their own caches, and some use their own encrypted DNS settings. That matters for websites, not for a VPN app that resolves names through the system, but if you test with a browser, check its own DNS settings too.

Step 3: Check the hosts file

The hosts file is a plain text list that maps names to addresses and wins over DNS. If a line for your VPN server's name exists, your device will use that address forever, no matter how often you flush or what any resolver says. Entries get there from old tutorials, security tools, a past troubleshooting attempt or a transferred configuration.

Typical locations:

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • macOS and Linux: /etc/hosts

Open it with administrator rights, look for your server name, and look for lines that map popular names to odd addresses. Lines starting with # are comments and do nothing. If you find an entry for the VPN server's name that you did not intend, comment it out by adding # at the start and save. Make a copy of the file first so you can restore it. If the file contains many entries from a security or ad-blocking tool, do not delete the lot; change only the line that concerns your server name, or ask the tool's settings to exclude it.

Then flush the cache again, since the old mapping may have been copied into it.

Step 4: Check the router and its DNS cache

Your router often acts as a small DNS forwarder, and many routers cache answers. If a phone and a laptop on the same Wi-Fi both fail but both work on mobile data, the router's cache is a good suspect.

Steps, from least to most effort:

  1. Restart the router. Most home routers clear their DNS cache on restart. Wait a couple of minutes after it comes back.
  2. Forget and rejoin Wi-Fi on the device, so it requests fresh network settings.
  3. Look at which DNS servers the device is told to use. If it uses the router's address, the router is forwarding queries somewhere. VPN and router DNS covers how to read that and what to change.
  4. As a test, set the device's DNS to a public resolver for that network only, then retry. If the VPN connects, you have located the layer. Whether to keep that setting is your choice; note it in case it affects other services on that network, such as local device names.

Some routers also have features that rewrite or block answers, such as parental filters, ad blockers and protection against DNS rebinding. If the answer you see is a block page or an odd local address, look at those settings.

Step 5: Understand TTL and why waiting sometimes works

If you cannot or do not want to flush a layer, time may fix it. After a record changes, resolvers should discard the old answer when its TTL runs out. TTLs vary a lot: some names use a few minutes, others use hours. A resolver you do not control, such as your internet provider's, will drop the old answer by itself eventually, though a few resolvers keep answers beyond the TTL.

Practical meaning:

  • If you flushed your device and restarted your router, and the problem remains, the remaining holder is probably upstream, and waiting for the TTL, or using a different resolver, is the realistic remedy.
  • If you can see the TTL in a dig answer (the number in the second column of the normal output, without +short), you know the longest an honest cache should keep the answer. Running dig server.example.net twice and watching the number count down shows that a cache is holding the answer.
  • A very short TTL does not mean the answer will always be fresh, only that a well-behaved cache should refresh soon.

A plain example

Mina uses her laptop at home. On Monday the VPN connects. On Wednesday it spins and times out, while her phone, on the same Wi-Fi, connects normally. Because only one device fails, she suspects a per-device cause.

She asks support for the name the app uses, then runs nslookup twice. Her laptop's normal answer is one address; the public resolver returns another. She flushes the cache with ipconfig /flushdns and retries. It still fails. She then opens the hosts file and finds a line for that name, added months ago while following an old tutorial. She comments it out, flushes again, restarts the app, and the VPN connects. The fix was the override, not the cache.

Had the hosts file been clean, her next steps would have been restarting the router, then trying a public resolver on that network, then waiting out the TTL. Notice the order: cheap and local first, shared and upstream later.

What this does not explain

Keep the idea in proportion. A stale name is one cause among many, and many failures that look similar are something else:

  • A network that blocks or filters VPN traffic, common on hotel, workplace, school or airline networks.
  • Wrong or mistyped credentials. Use the username and password from My Pass, not your website sign-in.
  • An expired pass.
  • A temporary problem at the server or at the supplier. If every device on every network fails, that is more likely than a cache.
  • A clock that is far off, a firewall rule, or security software that blocks the app.
  • An app that connects to a fixed address rather than a name, in which case DNS is not involved at all. Do not assume which kind your app uses.

Flushing caches also cannot change which country a website thinks you are in, since that is decided mostly by the IP address the website sees. If your issue is wrong location rather than failure to connect, read stale DNS cache and VPN location.

What to send to support if nothing works

If you have worked through the layers and the VPN still fails, a short, specific report saves time. Include the device and system version, the network type (home Wi-Fi, mobile data, public Wi-Fi), the exact error text or behaviour, the time of the attempt with your time zone, and the results of the two lookups (normal and public resolver). Say which caches you flushed and whether the hosts file had an entry. Never include your password or full login details in a message; the username and the time are enough for a person to look at the account.

Summary

A VPN app that connects by name depends on a DNS answer being current, and old answers can survive in the hosts file, the device cache, the router and upstream resolvers. Confirm the suspicion with a lookup against a public resolver, then clear the layers in order: device cache, hosts file, router, then wait or switch resolver for the TTL. If everything matches and it still fails, look at the network path, credentials, the pass and the server status instead. When you are ready to check or extend your access, you can find setup help in the Help Center.

Frequently asked questions

Can an old DNS answer really stop a VPN from connecting?

Yes, it can. Many VPN apps connect to a server by name. If your device, router or resolver still holds an old IP address for that name, the app may try an address that no longer accepts VPN connections and time out. It is only one possible cause, so confirm it before assuming it.

How do I flush the DNS cache on my computer?

On Windows run ipconfig /flushdns in a command prompt. On a Mac run sudo dscacheutil -flushcache and then sudo killall -HUP mDNSResponder. On Linux with systemd-resolved run resolvectl flush-caches. Commands can differ between versions, so check your system's documentation if one fails.

How can I tell whether my DNS answer is old?

Ask a public resolver for the same name with nslookup or dig and compare the address with what your normal resolver returns. If the two differ, and the public answer works while the cached one does not, a cache or override is the likely cause. Differences can also be normal when a name has several addresses.

Could my hosts file cause this?

Yes. A line in the hosts file overrides DNS completely for that name, so it keeps pointing at the address written there even after the real address changes. If you or a past tool added an entry for the server name, remove or update it.

What if flushing does not help?

Then the cause is probably something else, such as a blocked network, a wrong password, an expired pass or a temporary server problem. Work through the general connection checks and contact support with the error text and the time it happened.

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

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

Troubleshooting

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 read

Troubleshooting

VPN Server Unreachable: Troubleshooting

A layer-by-layer method for the VPN server unreachable error: how to tell a local network problem from a DNS or port problem, and when the fault is really on the server side.

9 min read