
- #Ping website network is unreachable linux ubuntu 18 update#
- #Ping website network is unreachable linux ubuntu 18 upgrade#
- #Ping website network is unreachable linux ubuntu 18 Pc#
Hope this saves someone a lot of hassle on a company administered PC.
#Ping website network is unreachable linux ubuntu 18 Pc#
I know this is not pretty, and pulls from many different solutions posted all over the internet, but it's the only one that works with my corporate administered PC and group policies. Note if your distribution isn't under \wsl$\debian\ you'll need to change it to where it actually resides. # Convert the DOS formatted file into UNIX format for WSL2 and write it in the proper place (\etc\nf, its primary location is \\wsl$\ from Windows) Sc -Path 'c:\Users\Public\Documents\nf' -Value ('nameserver ' + $nameserver) -Encoding utf8 # Run Set-Contents (sc) to write the nf file in a public location as it has DOS formatted line endings written by PowerShell, not readable by Linux $nameserver = Out-String -InputObject $nameserver # Convert nameserver object into a string Get-NetAdapter | Where-Object | select -ExpandProperty DNSServerSearchOrder
#Ping website network is unreachable linux ubuntu 18 update#
Hadn't used WSL 2 in months, was trying to sudo apt update from a Debian distro's terminal when I discovered my internet wasn't working. Troubleshooting steps before finding the above recipe:
#Ping website network is unreachable linux ubuntu 18 upgrade#
However curl -location -iĪnd sudo apt-get update & sudo apt-get upgrade now works. If you're lucky, WSL 2 should now be able to sudo apt-get update & sudo apt-get upgrade.įor me I am still unable to ping sites, but internet seems to work everywhere else in WSL 2.įor instance, ping (or pinging any site) And run each of these commands: wsl -shutdown
