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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Most WSL connection failures fall into one of five categories: DNS name resolution, general outbound routing, VPN or firewall interference, Windows-to-WSL service access, or .local multicast DNS. Identify the category first, then change only the setting that addresses it. WSL 2 uses NAT by default; Windows 11 version 22H2 and later can use mirrored networking and DNS tunneling, but those features have different prerequisites and limitations.

Use the diagnostic flow below to test the failure, verify your Windows and WSL versions, correct the relevant configuration, and restart WSL so the change takes effect.

1. Classify the failure before changing WSL settings

Open your distribution and test a literal IP address, a normal Internet hostname, a Windows-hosted service, and (if relevant) a .local name. The result tells you which branch to follow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Symptom Likely area First check
curl https://1.1.1.1 works but curl https://example.com fails DNS resolution or DNS transport Inspect /etc/resolv.conf and DNS tunneling
Neither an IP address nor a hostname is reachable Routing, NAT, firewall, VPN, or proxy Check the WSL interface, Windows connectivity, and VPN state
Internet works until a VPN connects VPN routes, NRPT policy, or VPN DNS handling Enable DNS tunneling and test the VPN’s documented WSL support
Windows cannot reach a server listening in WSL Localhost forwarding or inbound firewall rules Test the service on its listening address and port
Only names ending in .local fail Multicast DNS (mDNS) Check networking mode, DNS tunneling, WSL build, and Linux mDNS packages
One application fails while shell tests work Application proxy, certificate, or application-specific configuration Inspect that application’s proxy and network settings separately

Run these basic tests in WSL, replacing the example hostname or port with one you actually use:

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
getent hosts example.com
curl -I --max-time 10 https://example.com
curl -I --max-time 10 https://1.1.1.1
ip addr
ip route
cat /etc/resolv.conf

A failed ping is not conclusive: many Internet hosts block ICMP while allowing HTTPS. Prefer curl or the protocol used by your application.

2. Verify Windows and WSL versions

Mirrored networking and the documented DNS-tunneling defaults are Windows 11 features. Microsoft documents both for Windows 11 version 22H2 and later. The mirrored-mode guidance for .local names additionally requires WSL build 2.3.17 or newer.

Check the host and WSL versions from PowerShell:

winver
wsl --status
wsl --version
wsl -l -v

If wsl --version is unavailable, your WSL installation may use the older in-box component. Update WSL from an elevated PowerShell window, then check the version again:

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

Do not assume that a setting documented for Windows 11 22H2 exists on Windows 10 or on an old WSL package. A setting that is ignored by an older build can leave you troubleshooting the wrong problem.

3. Understand NAT and mirrored networking

WSL 2 uses a NAT-based virtual network by default. Linux receives a private virtual address and reaches external networks through Windows’ NAT. This is generally sufficient for outbound Internet access and for Windows reaching services through WSL’s localhost forwarding.

Mirrored networking changes WSL’s relationship with the host network. Microsoft lists IPv6 support, improved VPN compatibility, multicast support, LAN access, and supported localhost communication between Linux and Windows among its benefits. These are capabilities, not guarantees: a particular VPN, firewall policy, or enterprise network can still block traffic.

Consideration NAT (default) Mirrored mode
Availability Default WSL 2 architecture Windows 11 version 22H2 and later, with a current WSL package
Outbound Internet Uses Windows NAT Uses the mirrored host networking arrangement
VPN behavior Some VPN route changes break NAT Can improve compatibility, but specific VPN versions may remain incompatible
IPv6 and multicast Limited compared with mirrored mode Designed to support IPv6 and multicast scenarios
LAN access Requires NAT and firewall allowances Provides broader LAN access, subject to network and firewall policy
.local mDNS Not available when DNS tunneling is enabled Supported with WSL build 2.3.17 or newer and Linux mDNS configuration
Firewall exposure Windows and Hyper-V firewall rules can filter traffic Windows and Hyper-V firewall rules still apply

Enable mirrored mode

  1. In Windows, open your user profile folder and create or edit %UserProfile%.wslconfig. This is a global file for WSL 2, not a file inside a Linux distribution.
  2. Add the following section and setting:
[wsl2]
networkingMode=mirrored
  1. Save the file.
  2. Terminate the running WSL virtual machine so the global setting is reloaded:
wsl --shutdown
  1. Start the distribution again and repeat the tests from the first section.

If mirrored mode creates a new failure, remove the setting, run wsl --shutdown, and retest with NAT. That comparison distinguishes a mode-specific incompatibility from a general DNS or application problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

4. Fix DNS failures with DNS tunneling

DNS tunneling sends WSL DNS requests through a Windows virtualization path instead of putting DNS packets onto the virtual network between WSL and Windows. This matters when a firewall, VPN, or security product blocks those packets even though other traffic could work.

Microsoft enables DNS tunneling by default on Windows 11 version 22H2 and later and recommends it for VPN scenarios. You can explicitly set it in the global configuration on supported builds:

[wsl2]
dnsTunneling=true

After changing .wslconfig, run wsl --shutdown and start WSL again. Then inspect the generated resolver file and test a name:

cat /etc/resolv.conf
getent hosts example.com

DNS behavior that changes when tunneling is enabled

  • Windows VPN NRPT policies are applied to WSL DNS queries.
  • Windows DNS suffixes become available to Linux name resolution.
  • WSL can use Windows DNS servers beyond the three-server limit normally represented in a Linux resolv.conf.
  • Windows DNS encryption settings are applied to WSL queries carried through the tunnel.
  • Docker Desktop-managed container DNS queries bypass WSL DNS tunneling; a container failure therefore needs its own Docker DNS diagnosis.

If you deliberately need DNS-over-HTTPS or DNS-over-TLS configured inside Linux, disable DNS tunneling and manage DNS in Linux instead. Do not run two competing DNS designs without understanding which resolver is receiving each query.

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

Make sure resolv.conf generation is enabled

DNS tunneling depends on WSL’s automatic resolver configuration. In the distribution, inspect /etc/wsl.conf:

cat /etc/wsl.conf

Remove or comment out a setting that disables resolver generation, such as:

[network]
generateResolvConf=false

After editing, restart the entire WSL virtual machine:

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
wsl --shutdown

When the distribution starts, WSL can regenerate /etc/resolv.conf. A permanently hand-edited generated file is usually overwritten and can hide the actual mode or VPN problem.

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.

5. Treat VPN problems as a separate troubleshooting branch

Connect the VPN and repeat the IP-versus-hostname tests. If both fail only while the VPN is active, inspect routes and the VPN’s split-tunnel policy. If names fail while IP connections still work, the issue is usually DNS policy rather than the route itself.

For VPN use, Microsoft recommends DNS tunneling because many corporate VPNs rely on NRPT rules and private DNS suffixes. Enable tunneling, ensure generateResolvConf has not been disabled, run wsl --shutdown, and test a corporate hostname again.

Cisco AnyConnect is specifically documented as capable of changing routes in a way that prevents NAT from working. Some VPN versions are also documented as incompatible with mirrored mode. Do not treat mirrored mode as a universal VPN fix: check the current VPN vendor documentation, client version, and enterprise policy before selecting a mode.

Useful observations to collect for an administrator are:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Whether the failure begins immediately when the VPN connects.
  • The output of ip route before and after connection.
  • Whether public DNS names, corporate names, or both fail.
  • Whether Windows itself can reach the same destination.
  • Whether the VPN requires a proxy or installs a Windows NRPT policy.

6. Separate DNS from proxy and application configuration

WSL networking can be healthy while one tool fails because it has its own proxy, certificate store, or environment variables. Check the process environment:

env | grep -i proxy

Review the failing application’s proxy settings and its treatment of HTTPS certificates. Microsoft documents automatic proxy handling as a separate WSL networking consideration; changing DNS will not correct an invalid application proxy. Test with curl from the shell to determine whether the fault is below the application layer.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

7. Repair ordinary outbound Internet access

Check the WSL interface and route

Run:

ip addr
ip route
cat /etc/resolv.conf

You should see an interface with an address and a default route. If the interface or route is missing after a Windows sleep, update, or network transition, stop WSL completely and start it again:

wsl --shutdown

If the problem returns only after a VPN or security product starts, focus on that product’s virtual adapters and route policy rather than repeatedly editing Linux routes.

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

Check Windows connectivity and firewall state

Confirm Windows can browse to the destination while WSL cannot. Then inspect Windows Security at Windows Security > Firewall & network protection > Advanced settings. A firewall rule can block the virtual adapter, Hyper-V traffic, or a specific application even when ordinary Windows browsing works.

From an elevated PowerShell window, view the active firewall profiles:

Get-NetFirewallProfile | Format-Table Name, Enabled, DefaultInboundAction, DefaultOutboundAction

Do not disable every firewall profile as a general fix. If you must test a service, create a narrowly scoped rule for its port, verify the result, and remove or tighten the rule afterward.

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

8. Make Windows and WSL services reachable

Windows accessing a service in WSL

WSL supports localhost forwarding for applications listening in Linux. Start the service, confirm its listening socket, and test from Windows:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ss -lntp
curl http://127.0.0.1:3000

Replace port 3000 with the service’s actual port. If the service listens only on a particular Linux address, configure it to listen on the address required by your application; a process bound to an unexpected interface can appear unreachable even though WSL networking is functioning.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Linux accessing a Windows service in mirrored mode

Mirrored mode supports Linux-to-Windows localhost communication through 127.0.0.1 for supported scenarios. IPv6 localhost ::1 is not supported for that documented scenario, so test the IPv4 loopback address explicitly:

curl http://127.0.0.1:PORT

Replace PORT with a real number; do not assume a service listening only on ::1 will answer.

Allow inbound traffic deliberately

Inbound connections can be filtered by both Windows Firewall and the Hyper-V firewall. The safest workflow is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Identify the exact destination port and protocol, such as TCP port 8080.
  2. Open Windows Security > Firewall & network protection > Advanced settings > Inbound Rules.
  3. Select New Rule, choose Port, specify the protocol and port, choose Allow the connection, and limit the profiles and remote addresses to the networks that need access.
  4. Test the service from the required client.
  5. Disable or remove the rule if it was only a diagnostic test.

You can create a similarly scoped Windows rule from elevated PowerShell:

New-NetFirewallRule -DisplayName 'WSL TCP 8080 test' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8080 -Profile Private

Change the port and profile to match your service. On systems enforcing Hyper-V firewall policy, a Windows rule alone may not be sufficient; review the Hyper-V firewall settings and create the narrowest rule that permits the required WSL traffic.

9. Resolve .local hostnames with mDNS

Names ending in .local are commonly resolved with multicast DNS, not ordinary unicast DNS. That makes them a special case.

In NAT mode, .local resolution is not supported when DNS tunneling is enabled. Microsoft documents two approaches: disable DNS tunneling, or use mirrored mode. Disabling tunneling may reduce VPN and enterprise DNS compatibility, so use it only when mDNS is more important for that environment.

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

Mirrored-mode requirements for mDNS

  • Windows 11 version 22H2 or later.
  • WSL build 2.3.17 or newer for the documented mirrored-mode guidance.
  • networkingMode=mirrored in the global .wslconfig.
  • Linux mDNS support configured, for example with the libnss-mdns package and the distribution’s name-service configuration.
  • Multicast traffic permitted by the host and network firewalls.

After installing and configuring the Linux mDNS components, restart WSL and test:

getent hosts printer.local
ping -c 1 printer.local

Use getent as the name-resolution test; a device may resolve correctly while refusing ICMP echo requests.

10. Recovery recipes for common combinations

Public names fail, IP addresses work

  1. Check cat /etc/resolv.conf.
  2. Ensure generateResolvConf is not disabled in /etc/wsl.conf.
  3. On Windows 11 22H2 or later, enable DNS tunneling in .wslconfig or confirm its default is active.
  4. Run wsl --shutdown, restart the distribution, and retry getent hosts example.com.

Everything fails only when a VPN is connected

  1. Record ip route with the VPN disconnected and connected.
  2. Enable DNS tunneling and restart WSL.
  3. Test a public IP, a public hostname, and a corporate hostname separately.
  4. Check the VPN vendor’s current WSL, NAT, and mirrored-mode compatibility notes. A documented route conflict, including the Cisco AnyConnect NAT issue, may require a vendor-side configuration change.

Windows cannot open a WSL development server

  1. Confirm the process is listening with ss -lntp.
  2. Test http://127.0.0.1:PORT on Windows.
  3. Check Windows Firewall and Hyper-V firewall rules for that port.
  4. If remote LAN clients also need access, create a narrowly scoped inbound rule and ensure the service is bound to an address reachable from those clients.

Only .local names fail

  1. Confirm the name is provided by mDNS rather than a conventional DNS server.
  2. Use mirrored mode on a supported Windows and WSL build, or disable DNS tunneling if you must remain in NAT mode.
  3. Install and configure Linux mDNS support, then verify multicast is not blocked.

11. Configuration checklist

  • Use .wslconfig for global WSL 2 settings such as networkingMode and DNS tunneling.
  • Use /etc/wsl.conf for settings belonging to one distribution, including resolver-generation behavior.
  • Run wsl --shutdown after changing either file.
  • Keep NAT unless you need mirrored-mode capabilities such as multicast, broader LAN access, or a particular VPN behavior.
  • Keep DNS tunneling enabled for most VPN and enterprise DNS configurations unless you intentionally manage DNS inside Linux or need NAT-mode mDNS.
  • Scope firewall changes to the required protocol, port, profile, and source network.
  • Retest with a known IP, a public hostname, a corporate hostname, a localhost service, and a .local name only when each case applies.

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.