Quick Answer
Flush DNS, restart the VPN service, and check your firewall logs. 9 times out of 10 that's it.
Why This Happens
Your VPN client sits there spinning on 'Connecting' because it can't establish a tunnel. The culprit is almost always DNS resolution failing (the client can't find the VPN server's IP) or a firewall rule blocking the UDP ports (usually 500, 4500, or 1194). I've seen this on Windows 10, Windows 11, and macOS Ventura. It's not the VPN itself 99% of the time – it's something in your network stack getting in the way.
The typical scenario: you just installed a VPN client, or you switched networks (from office Wi-Fi to home). The client tries to connect, times out after 30-60 seconds, and stays stuck. Don't bother reinstalling the client yet – that rarely fixes it.
Fix Steps – Do These in Order
- Flush DNS cache. Open Command Prompt as admin (Windows) or Terminal (Mac). Type:
On Mac:ipconfig /flushdns
Then try connecting again.sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Reset your network stack. In admin Command Prompt:
Reboot. This clears any corrupted socket states or IP settings.netsh winsock reset netsh int ip reset - Check firewall port rules. Go to Windows Defender Firewall (or your third-party firewall) and make sure UDP ports 500, 4500, and 1194 are allowed outbound. If you use a corporate firewall, ask your network team to verify these ports aren't throttled. I've seen Meraki firewalls silently drop UDP after 5 seconds of idle – that's a known issue.
- Disable IPv6. On Windows, go to Network Settings > Change adapter options, right-click your adapter, uncheck Internet Protocol Version 6 (TCP/IPv6). Some VPN clients can't handle IPv6 and fall over. This is a quick test – re-enable it after if it doesn't help.
- Use a different DNS server. Set your DNS to Cloudflare's 1.1.1.1 or Google's 8.8.8.8. ISP DNS servers often fail for VPN endpoints. On Windows: Settings > Network & Internet > Change adapter options > select your connection > Properties > Internet Protocol Version 4 (TCP/IPv4) > Use the following DNS server addresses. Put 1.1.1.1 and 1.0.0.1.
If the Main Fix Fails
Try these in this order:
- Turn off split tunneling. If you have it enabled, disable it temporarily. Some VPN clients (looking at you, OpenVPN and WireGuard) mess up routing tables when split tunneling is on. Reconnect after disabling.
- Reinstall the VPN client. Uninstall, reboot, then download the latest version from the official site. Don't use cached installers – they might be outdated. This clears any corrupted config files or registry entries.
- Try a different protocol. If your client supports OpenVPN, IKEv2, and WireGuard, switch between them. Some networks block UDP but allow TCP. For instance, hotel Wi-Fi often blocks UDP – switch to TCP port 443 (looks like HTTPS).
- Check the system time and date. If the clock is off by more than 5 minutes, certificate validation fails. Fix it via Settings > Time & Language > Sync now. Also make sure the time zone is right.
Prevention Tip
Once you're connected, set up a scheduled task to flush DNS every hour if you're on roaming networks. Or use a DNS caching tool like Unbound locally. Most importantly, keep your VPN client updated – the big releases (like OpenVPN 2.6) fixed a ton of connection-handling bugs. Also, if you use a corporate VPN, tell your IT to set the connection timeout higher than 30 seconds – I've seen 15-second timeouts on Cisco AnyConnect that cause these hangs.
That's it. If none of this works, you've probably got a deeper issue like a broken VPN driver or a certificate problem on the server side. Then you'll need to check the client logs – look in %ProgramData%\[VPN vendor]\log for specific errors. But for most people, steps 1-4 solve it quick.