How to Fix WSL Network Not Working — No Internet in Linux Subsystem on Windows
WSL (Windows Subsystem for Linux) has no internet, DNS resolution failing, or can't reach network resources from Linux? Fix WSL networking.
📖
Main Troubleshooting Guide
How to Fix No Internet Connection →Complete symptoms, causes, and step-by-step solutions
Symptoms
You might be experiencing this problem if you notice:
- •apt update / apt install fails with network errors in WSL
- •ping: Name or service not known inside WSL
- •curl/wget can't connect to any URLs from WSL
- •WSL network was working but broke after Windows or VPN update
- •DNS resolution fails but IP connections work in WSL
- •WSL can't access host machine or LAN resources
Common Causes
- ⚠WSL DNS configuration auto-generated incorrectly
- ⚠VPN software breaking WSL network routing
- ⚠Windows Firewall blocking WSL network traffic
- ⚠Hyper-V virtual switch misconfigured
- ⚠resolv.conf being overwritten on each WSL start
- ⚠WSL 2 networking mode incompatible with network setup
Solutions
Solution 1: Fix DNS Resolution
- 1Most common WSL network issue is DNS:
- 2In WSL terminal: sudo nano /etc/resolv.conf
- 3Replace contents with: nameserver 8.8.8.8
- 4Save and test: ping google.com
- 5To prevent WSL from overwriting resolv.conf:
- 6sudo nano /etc/wsl.conf
- 7Add: [network]\ngenerateResolvConf = false
- 8Then: wsl --shutdown (from Windows CMD) and restart WSL
Solution 2: Fix VPN Conflicts
- 1VPNs often break WSL2 networking because of routing:
- 2Option 1: In .wslconfig (Windows user folder):
- 3[wsl2]\nnetworkingMode=mirrored
- 4This mirrors Windows network config into WSL (requires Win11 22H2+)
- 5Option 2: Disconnect VPN, test WSL network, reconnect
- 6Option 3: Configure VPN split tunneling to exclude WSL subnet
- 7WSL2 default subnet: check with "ip addr" in WSL
Solution 3: Reset WSL Networking
- 1From Windows CMD/PowerShell:
- 2wsl --shutdown
- 3netsh winsock reset
- 4netsh int ip reset
- 5Restart Windows
- 6Start WSL again — network adapter should recreate
- 7If still broken: wsl --update (updates WSL kernel)
- 8Nuclear option: wsl --unregister Ubuntu && wsl --install Ubuntu
FIXES THIS IN 5 MINUTES
Fix WSL Network Not Working — No Internet in Linux Subsystem Automatically
RescuePC Toolkit includes 109+ automated repairs that fix this problem with one click. No command line knowledge required.
Download Now - Free TrialNo credit card required • Works on Windows 10 & 11