WSL2 Network Not Working – Complete Fix Guide (2026)
Table of Contents
- Why WSL2 Network Not Working Happens
- 1. Restart WSL and Windows
- 2. Fix DNS Resolution in WSL2
- 3. Check and Repair resolv.conf
- 4. Configure Proxy Settings for WSL2
- 5. Restart WSL Network Adapter
- 6. Update WSL and Kernel
- 7. Check Windows Firewall Settings
- 8. Fix VPN Interference with WSL2
- 9. Advanced Troubleshooting
- Conclusion
- FAQ
Hub: Windows 11 Troubleshooting Hub
Quick Answer
WSL2 Network Not Working occurs when the Windows Subsystem for Linux cannot access the internet or local network. To fix it, restart WSL and Windows, fix DNS resolution by editing /etc/resolv.conf, configure proxy settings, restart the WSL network adapter, update WSL and kernel, check Windows Firewall, and resolve VPN conflicts. If the error persists, perform advanced troubleshooting like resetting WSL or checking Hyper-V settings. For more Windows troubleshooting, visit our Windows 11 Troubleshooting Hub.
Why WSL2 Network Not Working Happens
WSL2 Network Not Working is a common issue where the Windows Subsystem for Linux (WSL2) cannot access the internet or communicate with other devices on the network. WSL2 uses a virtualized network adapter that shares the host’s internet connection, but configuration issues can break this connectivity. For official Microsoft documentation, refer to the Microsoft WSL Networking documentation.
WSL2 Network Not Working can be caused by several factors: DNS resolution failures, corrupted /etc/resolv.conf, proxy configuration issues, Windows Firewall blocking WSL traffic, VPN conflicts, outdated WSL kernel, or Hyper-V network adapter problems. This error is similar to other network issues like DNS Server Not Responding and Default Gateway Is Not Available, but it specifically affects the WSL2 virtual environment.
Before diving into fixes, check if your Windows host has internet access. If Windows cannot connect to the internet, fix that first. For a broader overview of network errors, see our Windows 11 Troubleshooting Hub.
⚠️ Warning: WSL2 Network Not Working can be caused by VPNs that override DNS settings. If you are using a VPN, try disconnecting it first.
1. Restart WSL and Windows
The simplest fix for WSL2 Network Not Working is restarting WSL and your computer. This clears temporary network glitches and refreshes the virtual network adapter.
- Open PowerShell or Command Prompt as Administrator.
- Shut down WSL:
wsl --shutdown - Restart your Windows computer.
- After restart, open WSL and test network connectivity:
ping google.com
✅ Expected Result: A restart often resolves WSL2 Network Not Working immediately. If not, proceed to the next method.
2. Fix DNS Resolution in WSL2
DNS resolution failures are a common cause of WSL2 Network Not Working. You can ping IP addresses but not domain names. Fixing DNS can resolve the issue.
- Open your WSL terminal (e.g., Ubuntu).
- Check if DNS is working:
nslookup google.com - If DNS fails, edit the resolv.conf file:
sudo nano /etc/resolv.conf - Add Google DNS servers:
nameserver 8.8.8.8 nameserver 8.8.4.4 - Save the file (Ctrl+O, then Ctrl+X).
- Make the file read-only to prevent overwriting:
sudo chattr +i /etc/resolv.conf - Test DNS resolution again.
💡 Quick Tip: If /etc/resolv.conf is overwritten on reboot, create a /etc/wsl.conf file with [network] generateResolvConf = false to prevent automatic generation.
3. Check and Repair resolv.conf
WSL2 automatically generates /etc/resolv.conf based on Windows DNS settings. If this file is corrupted, WSL2 Network Not Working can occur.
- Open your WSL terminal.
- Check the current resolv.conf:
cat /etc/resolv.conf - If the file is missing or empty, regenerate it by restarting WSL:
- In PowerShell (Admin):
wsl --shutdown - Restart WSL and check resolv.conf again.
- If the file contains incorrect nameservers, edit it manually as shown in Method 2.
🔁 Alternative Solution: You can also use the Windows DNS server by setting nameserver $(ip route show default | awk '/default/ {print $3}').
4. Configure Proxy Settings for WSL2
If you are behind a corporate proxy, WSL2 Network Not Working can occur because WSL does not automatically inherit Windows proxy settings. Configuring the proxy manually can resolve the issue.
- Open your WSL terminal.
- Set the HTTP and HTTPS proxy:
export http_proxy="http://proxy-server:port" export https_proxy="http://proxy-server:port" - Test with curl:
curl -I http://google.com - To make the proxy persistent, add the exports to
~/.bashrc:echo 'export http_proxy="http://proxy-server:port"' >> ~/.bashrc echo 'export https_proxy="http://proxy-server:port"' >> ~/.bashrc
💡 Quick Tip: You can also automatically detect Windows proxy settings using a script that reads the Windows registry.
5. Restart WSL Network Adapter
Restarting the WSL network adapter can resolve WSL2 Network Not Working by refreshing the virtual network interface.
- Open PowerShell as Administrator.
- Check WSL network interfaces:
Get-NetAdapter -Name "*WSL*" - Disable and re-enable the WSL adapter:
Disable-NetAdapter -Name "vEthernet (WSL)" -Confirm:$false Enable-NetAdapter -Name "vEthernet (WSL)" -Confirm:$false - Restart WSL:
wsl --shutdown - Open WSL and test connectivity.
✅ Expected Result: Restarting the WSL network adapter often resolves WSL2 Network Not Working.
6. Update WSL and Kernel
Outdated WSL versions or kernels can cause WSL2 Network Not Working. Updating WSL can resolve compatibility issues.
- Open PowerShell as Administrator.
- Update WSL:
wsl --update - Check the WSL version:
wsl --version - Ensure WSL2 is set as default:
wsl --set-default-version 2 - Restart your computer.
🔁 Alternative Solution: If wsl --update fails, download the latest WSL kernel from the Microsoft GitHub repository.
7. Check Windows Firewall Settings
Windows Firewall can block WSL2 network traffic, causing WSL2 Network Not Working. Adding firewall rules can resolve the issue.
- Open Windows Security > Firewall & network protection.
- Click “Allow an app through firewall”.
- Find “Windows Subsystem for Linux” and ensure both Private and Public are checked.
- If not listed, add it manually.
- Alternatively, temporarily disable the firewall to test:
- Click “Turn Windows Defender Firewall on or off”.
- Turn off the firewall for your network profile.
- Test WSL connectivity.
- Turn the firewall back on immediately after testing.
⚠️ Warning: Only disable the firewall temporarily for testing. Re-enable it immediately to maintain system security.
8. Fix VPN Interference with WSL2
VPNs can override network settings and cause WSL2 Network Not Working. Resolving VPN conflicts can restore connectivity.
- Disconnect your VPN and test WSL connectivity.
- If WSL works without VPN, the VPN is the issue.
- Some VPNs allow split tunneling:
- Enable split tunneling in your VPN settings.
- Exclude WSL traffic from the VPN.
- Alternatively, use the VPN’s DNS settings in WSL:
sudo nano /etc/resolv.conf - Add the VPN’s DNS server addresses.
💡 Quick Tip: Some VPNs like Cisco AnyConnect or OpenVPN require specific configuration to work with WSL2.
9. Advanced Troubleshooting
If the error persists, try these advanced solutions.
Reset WSL
Backup your WSL data, then unregister and reinstall the distribution. This can resolve persistent WSL2 Network Not Working issues.
Check Hyper-V Settings
WSL2 relies on Hyper-V. Ensure Hyper-V is enabled: Control Panel > Programs and Features > Turn Windows features on or off > Windows Hypervisor Platform.
Check WSL Configuration
Check /etc/wsl.conf for network settings. A misconfiguration can cause WSL2 Network Not Working.
Use Windows Network Troubleshooter
Run the built-in network troubleshooter on Windows to identify and fix underlying network issues.
Check for Malware
Malware can interfere with network settings. Run a full scan with Windows Defender Offline. For detailed steps, see How to Scan Malware Windows 11.
Perform a System Restore
If the error started after a system change, use System Restore to revert. See How to Use System Restore Windows 11.
For more Windows and networking troubleshooting, explore our Windows 11 Troubleshooting Hub.
Conclusion
WSL2 Network Not Working is a common issue that can be fixed by restarting WSL, fixing DNS resolution, repairing /etc/resolv.conf, configuring proxy settings, restarting the WSL network adapter, updating WSL, checking firewall settings, and resolving VPN conflicts. If the error persists, perform advanced troubleshooting like resetting WSL or checking Hyper-V settings. By following these steps, you can restore network connectivity in WSL2.
Regular system maintenance, such as keeping WSL updated and periodically checking DNS settings, can prevent WSL2 Network Not Working from recurring. For more Windows and networking troubleshooting, explore our Windows 11 Troubleshooting Hub and check out related articles on DNS Server Not Responding, Default Gateway Is Not Available, and Windows 11 No Internet Secured Wi-Fi Error.
Related Guides
- Windows 11 Troubleshooting Hub
- DNS Server Not Responding in Windows 11
- Default Gateway Is Not Available
- Windows 11 No Internet Secured Wi-Fi Error
- IPv6 Partial Connectivity
- WSL2 DNS Resolution Fix
- Hyper-V Virtual Switch Network Drop Fix
- WSL2 Proxy Configuration Guide
- Windows Firewall WSL Traffic Fix
- How to Update Drivers Windows 11
- How to Use System Restore Windows 11
- How to Scan Malware Windows 11
- Windows 11 High CPU Usage Fix
- Windows 11 Running Slow Fix
FAQ
Why is WSL2 Network Not Working?
WSL2 Network Not Working is caused by DNS resolution failures, corrupted resolv.conf, proxy configuration issues, Windows Firewall blocking WSL, VPN conflicts, or outdated WSL kernels.
How do I fix WSL2 Network Not Working?
Restart WSL, fix DNS resolution by editing /etc/resolv.conf, configure proxy settings, restart the WSL network adapter, update WSL, check Windows Firewall, and resolve VPN conflicts.
Can DNS cause WSL2 Network Not Working?
Yes, DNS resolution failures are one of the most common causes of WSL2 Network Not Working. Fixing resolv.conf often resolves the issue.
How do I fix DNS in WSL2?
Edit /etc/resolv.conf and add nameserver 8.8.8.8 and 8.8.4.4. To prevent overwriting, run sudo chattr +i /etc/resolv.conf.
Can a VPN cause WSL2 Network Not Working?
Yes, VPNs can override DNS and routing settings. Disconnect your VPN or use split tunneling to exclude WSL traffic.
How do I restart the WSL network adapter?
In PowerShell as Administrator, run Disable-NetAdapter -Name "vEthernet (WSL)" -Confirm:$false followed by Enable-NetAdapter -Name "vEthernet (WSL)" -Confirm:$false.
Can Windows Firewall block WSL2 network?
Yes, Windows Firewall can block WSL2 traffic. Ensure “Windows Subsystem for Linux” is allowed through the firewall.
How do I update WSL to fix network issues?
In PowerShell as Administrator, run wsl --update to update WSL to the latest version.
What should I do if the error persists after all fixes?
If the error persists, reset WSL, check Hyper-V settings, run the Windows Network Troubleshooter, or perform a System Restore.
Is WSL2 Network Not Working a hardware or software issue?
It is primarily a software issue caused by configuration conflicts, drivers, or firewall settings. Hardware issues are rarely the cause.
We’re a team of system administrators, technical writers, and platform specialists who genuinely enjoy solving the problems most users find frustrating. From persistent Windows errors and Android sync failures to browser crashes and network drops — we’ve seen it all, and we document every fix properly. Our guides are built on official documentation, direct testing, and real troubleshooting experience. No filler, no guesswork — just reliable, step-by-step solutions you can trust.