15 Oct 2025 ~ 2 min read

The joys of WSL ⇆ Windows Networking


I’ve been doing a lot of tests in my homelab and getting quite aggravated with having to get up and move between different machines and toggling various KVM switches to do all of my testing.

Aggravation being the step-mother of invention, I decided to SSH and VNC to them.  And that lowered the aggravation enough for a while.

But then I realized that it worked from windows, accessing all of my machines by their hostnames, the pi 5, the linux laptop, multiple windows machine, a mac.  All was well, except most of the time that it was not!

From WSL where I seem to spend most of my time I couldn’t get to them.  Routes wouldn’t resolve.

I spent a while looking into this and the peculiarities of WSL networking, and from what I learned spent a bunch of time using the new DNS mirroring that Microsoft added to WSL Ubuntu.  It doesn’t work for everything in both directions.  So I pointed the networking in /etc/resolv.conf nameserver to the gateway’s IP address which worked for a bit.  But as soon as you restart the terminal it gets overwritten. If you want to look up more information about the new WSL networking additions, check this link at Microsoft. [Advanced settings configuration in WSL](Advanced settings configuration in WSL | Microsoft Learn)

So the solution i finally came up with was, in /etc/resolv.conf


#you'll have to do a sudo chattr -i /etc/resolv.conf, delete this file,, then restart wsl2 to go back to the way it originally worked.

nameserver _your_gateway_ip_address_

options edns0 trust-ad

search .

then:


sudo chattr +i /etc/resolv.conf

and it worked.  WSL is no longer blind on the network.

I hope this helps someone


Hi, I'm Jon. I'm a software engineer based in Kissimmee, FL.
You can find me here and on LinkedIn,