Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

Restore Internet Access in Hyper-V and WSL2: A Safe Troubleshooting Guide

When Hyper-V or WSL2 loses internet access, check Windows connectivity and DNS first. Then investigate VPNs, firewall policy, mirrored networking, and targeted HNS cleanup.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Hyper-V virtual machine or WSL2 suddenly cannot reach the internet, first check whether Windows itself is online, then separate a DNS problem from a broader connection failure. The Default Switch is only one possible part of the path: WSL networking mode, VPNs, firewall policy, DNS settings, and Windows’ virtual networking services can also be involved. Start with the low-impact checks below; save HNS cleanup for the specific stale-rule problem Microsoft documents.

Check what is actually offline before changing settings

A Default Switch problem is not confirmed just because a guest has lost internet access. A 2020 Microsoft Q&A post describes a Hyper-V guest and WSL2 losing connectivity at the same time, but that report does not establish a shared cause for other systems. Microsoft Q&A: Hyper-V VM network connection problem with Default Switch.

As an Amazon Associate I earn from qualifying purchases.

Record these details before attempting a reset:

  • Does Windows have internet access?
  • Does the problem affect every WSL distribution, every Hyper-V guest, or only one guest?
  • What Windows build and WSL version are installed?
  • Is a VPN or third-party firewall active, or is the computer managed by an organization?
  • Did the issue begin after a Windows update, VPN change, network change, or policy update?

These checks help distinguish a host connection problem from a guest-specific issue and can reveal whether organizational firewall policy or VPN behavior is relevant. Microsoft lists several possible WSL networking layers rather than identifying a single universal cause. Microsoft’s WSL troubleshooting guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Determine whether the failure is DNS or general connectivity

In the affected WSL distribution, compare access to a known IP address with access to a domain name. If an IP is reachable but names do not resolve, focus on DNS rather than treating the symptom as a complete loss of network connectivity. If neither works, investigate the broader network path, firewall, VPN, and host state.

Microsoft explains that WSL DNS requests can be blocked by existing network configuration when they travel from the WSL virtual machine to the Windows host. DNS tunneling provides a different path: WSL communicates with Windows through a virtualization feature, which can help DNS requests use Windows policies. Microsoft says DNS tunneling is enabled by default on Windows 11 version 22H2 and later, and recommends it for VPN scenarios where Windows Name Resolution Policy Table (NRPT) rules need to apply to WSL DNS queries. Availability and behavior depend on Windows and WSL configuration. Microsoft Learn: Accessing network applications with WSL and Microsoft’s WSL troubleshooting guide.

Check VPN and firewall behavior without disabling protection

A VPN, security product, or managed firewall policy can change which traffic is allowed or how DNS is resolved. Microsoft notes that enterprise firewall rule-merging policy can block WSL networking and documents VPN compatibility issues. Mirrored networking may improve VPN compatibility, but Microsoft does not guarantee compatibility with every VPN or security product. Do not turn off the Windows firewall wholesale as a troubleshooting shortcut; on a managed computer, ask the administrator to review the relevant policy.

Hyper-V firewall rules are another possible layer. Microsoft says the Hyper-V firewall feature was introduced with Windows 11 version 22H2. It is on by default for Windows 11 version 22H2 with WSL 2.0.9 and later, according to Microsoft Learn. The effect of a firewall rule depends on the system’s configuration, so check policy and rule scope rather than assuming the firewall is the cause. Microsoft Learn: Hyper-V Firewall, Accessing network applications with WSL.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Restart WSL before attempting network cleanup

For a WSL-only interruption, stop running WSL instances and start the distribution again:

  1. Save work in all open WSL sessions. Stopping WSL closes running instances.
  2. In Windows Terminal, PowerShell, or Command Prompt, run wsl --shutdown.
  3. Reopen the distribution and check connectivity again.

This is a relatively low-impact reset, not a guaranteed fix: it will not correct a blocked firewall rule, unsuitable VPN behavior, or a host connection failure. Microsoft includes stopping or shutting down WSL in its troubleshooting guidance. Microsoft’s WSL troubleshooting guide.

Consider mirrored networking if your Windows version supports it

WSL uses NAT networking by default. Microsoft recommends trying mirrored networking for its latest features and improvements. Mirrored mode is available on Windows 11 version 22H2 and later, and Microsoft lists improved VPN compatibility, IPv6 support, multicast, and LAN access to WSL among its benefits. It changes WSL’s networking architecture; it is an alternative to evaluate, not proof that Hyper-V’s Default Switch has failed. Microsoft Learn: Accessing network applications with WSL.

To configure it, add the setting under the [wsl2] section in %UserProfile%.wslconfig:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[wsl2]
networkingMode=mirrored
  1. Save the file as .wslconfig in your Windows user-profile folder.
  2. Run wsl --shutdown so WSL restarts with the updated configuration.
  3. Open WSL and test the connection again.

Mirrored mode does not guarantee that a particular VPN or security product will work. It also does not make internet access and inbound access the same issue: if the goal is to reach a service running inside WSL from another device, check the relevant Hyper-V firewall configuration separately. Microsoft Learn: Accessing network applications with WSL and Microsoft Learn: Hyper-V Firewall.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use HNS cleanup only for the documented stale DNS-rule case

Microsoft documents a particular failure in which an HNS firewall rule for DNS, UDP port 53, refers to an old WSL interface identifier. Its workaround is not a general-purpose Default Switch reset: it involves stopping WSL, removing the stale rule and HNS endpoints, then restarting the Host Network Service (HNS) or rebooting. Removing HNS endpoints can affect other virtual-networking consumers. Microsoft warns that other HNS-managed features, such as Windows Sandbox or Microsoft Defender Application Guard (MDAG), may need to be stopped first. Microsoft’s WSL troubleshooting guide.

Do not delete HNS endpoints just because a VM or WSL has no internet. Confirm that the documented stale DNS-rule condition applies, follow Microsoft’s current instructions, and check administrator policy before proceeding. If the computer uses other HNS-managed features, account for their state before restarting HNS or rebooting.

Choose the next check based on the symptom

What you observe Where to focus
Windows itself is offline Restore the Windows host’s connection before treating WSL or a VM as the root problem.
Windows is online; WSL reaches an IP but cannot resolve names Investigate DNS configuration, DNS tunneling eligibility, VPN behavior, and the documented stale UDP/53 HNS rule only if that specific case applies.
Windows is online; WSL cannot reach IPs or names Check VPN and firewall policy, then try a WSL shutdown and restart. Evaluate mirrored networking if supported by the Windows version.
Only one Hyper-V guest is affected Compare that guest’s network configuration with a working guest before assuming a WSL-wide or host-wide failure.
Both WSL and multiple guests fail, or the device is managed Review host networking changes and organizational firewall or VPN policy; avoid broad resets that may disrupt other virtual networking features.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.