-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2 - No internet connectivity. DNS Issues(Temporary failure in name resolution) #6404
Comments
Elementary Watson! All WSL distro are derived from the corresponding Cloud VM distros. These distros are systemd based Linux distros. The Network Manager is responsible for network configuration and every infrastructure provides the hook that configures the resolv.conf: This file is part of cloud-init. See LICENSE file for license information.This script hooks into NetworkManager(8) via its scriptsarguments are 'interface-name' and 'action'is_azure() { is_enabled() { if is_enabled; then All this mechanism heavily relies on systemd-resolved daemon. Without this initialization process /etc/resolv.conf is only a symbolic link pointing to /run/systemd/resolve/stub-resolv.conf created during distro installation: No DNS servers known.This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:[network]generateResolvConf = falsenameserver 172.20.160.1 With generateResolvConf = false your nameserver is always 172.20.160.1 |
I have tried all this but no luck. I still see the same issue |
Every time when WSL terminal is opened WSL generates the resolv.conf regardless of how it is configured in wsl.conf. The wsl.conf is only the link to the "real" resolv.conf file generated normally bi the systemd-resolved daemon. This is documented for such Linux distro as Ubuntu. Suse, CentOS, Debian. See for example systemd-resolved Suse and systemd-resolved Debian. |
After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl. a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of
I Just tried to put it at |
Also got this issue from the recent 1010 update. |
I run Windows 10 Pro Insider preview build 212921010 |
I didn't see this reply. I did this and it also fixed my recent issue. |
Resolv.conf generation in the current implementation is a useless and harmful feature in the most cases. Even Chrome knows to test DNS availability 1st according to "DNS PROBE ERROR" appears in the case of connectivity issues. Google shows a long list of The "best DNS determination" tools. The correct DNS selection depends on the status of network interfaces and how the host is connected to the global internet infrastructure. Also, DNS protocol can vary from UDP to DOH The best choice is always the DNS that is connected to the LAN itself. IT is 99.9% available and can be easily rebooted. Its status can be easily tested using nslookup 8.8.8.8 - must return name = dns.google . |
Thanks for reporting the issue @devshashankb . Can you please follow these instructions and share the script output, and both |
I have this issue happened recently too .
and change /etc/resolve.conf doesn't solve my problem . ifconfig show nothing. |
"Temporary failure in name resolution" looks like a message coming from DNS client or server. |
@devshashankb I am afraid you are 100% correct and WSL team is 100% not :(. In the recent and most useful Linux distros DNS resolution is so tightly coupled with systemd mechanism, resolved service, and dbus service that any alternative solution is not possible. The provided by Debian, Ubuntu, and Fedora distro lines services are perfectly tuned to the modern networking and cloud computing environment. The old Windows-like solution has stopped working without mitigation using Router configuration that enables DynDNS and other than UDP protocols usage. -- Information acquired via protocol DNS in 12.8ms. But my /etc/resolv.conf link is overridden every wsl "login". I have to re-create it manually every time. Otherwise, these systemd based Linux distros can't access the internet, i.e cloud services, repositories,etc. deployed globally Every attempt to resolve DNS names using "old static DNS servers" results in a "temporary" DNS resolution error, as expected. |
Hey, I succeeded to run systemd-resolved service manually and it found 3 critical issues:
|
After a few weeks of experience with the real-world Linux distro used as a WSL image that managed by systemd, I found that if the original distro was systemd-based then all games with /etc/resolv.conf affect nothing. Every program built with the networking libraries for these distro establishes IPC connection with systemd-resolve using D-Bus and the DNS resolver daemon solves for the "client" program all issues related to DNS using its own configuration: interface to communicate with DNS, protocol, possible delegation to the globally deployed dDNS service, etc. Everything works because the modern Internet infrastructure is virtually unbreakable. When I run OCI containers in my distro the running container gets the correct resolv.conf content as magic. |
I didn't even know we could run other distrib than the one given by the store. |
All WSL distros published in the Microsoft store are plain so-called
initrd distros, i.e. distros with read-only compressed into single file
root fs that is used for 1st-time boot. There is nothing new in it. I think
all Linux distro can be started from USB, CD, or Network. To install any
Linux distro you need either some rootfs ext4 file of the corresponding
distro or tar file of some existing distro exported by another developer to
be imported and registered as in Export and import WSL distro
<https://docs.microsoft.com/en-us/windows/wsl/reference> Both things are no
so rare asset - use google or Linux community sites.
If you use the 1st method you have to open regedit and copy/paste/edit the
set of entries like for already existing distro.
under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
. If you use the 2nd method you can simply use wsl --import to create
distro FS in the desired location with the desired name from the tar file.
Pros:
1. Both methods work unlike installation from Microsoft store that results
in died distro fo 20$.
2. You have more freedom in the Distro name and rootfs location.
3. You have the real support from the Software house maintaining the distro
instead of opening issues for WSL and waiting 6 months until somebody will
read it.
4 You can upgrade your distro from the original distro repositories
whenever you want without saying "Sorry, I need to upgrade and change the
initialization method of my distro to systemd. Why I have the same issues
as in the original distro from MS Store and nobody care to correct the
image in the MS Store.
|
Is there a chance that you are getting the DNS resolution error, while on a VPN? Because this is exactly the same problem I am having for some months now and because I dont have admin rights on my working maschine I am not able to make it work. It have been 4-5 months now without using my WSL2 on a VPN. |
Some reaction from Microsoft? |
You have to change
After that go to
After that in Powershell type Now your resolv.conf will be the same. |
I did exactly that. Although WSL2 won't generate Edition Windows 10 Home Insider Preview |
It deletes the file? That never happened to me. It must be something else you have setup, to that to happen. |
I'm working with WSL2 and Ubuntu 20.04LTS Ok try this solution (it works for me) :Create
1 . Rename link 2 . Create and edit new resolv.conf file (not a link) : and just add this line (indicate your livebox gateway address / (orange for me)) :
3 . Don't forget to change authorization :
4 . close console and reopen it. just type : 5 . Try to update linux ( I hope enjoy for you too ! Edition Windows 10 Professional 20H2 |
I tried this unforunately it doesn't work for me |
Ubuntu, CentOS, Fedora,Suse are systemd-based distros today. Most of utilities and applications are written in assumption that the distro is booted by systemd, NetworkManager and Resolved services have done their job and serve everybody via D-Bus. The /etc/resolv.conf link only points to resolv.conf stub and the content of /etc/resolv is not so important, Configuration of NM and Resolved consists of dozens of lines and allows to config networking in the very complex setups. /etc/resolv.conf allows to configure network only if the computer is attached to the wall using a basic modem. But it is relikt setup today. What do you expect? |
How it works in my setup with genie and systemd:
Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: /usr/lib/systemd/network/80-container-ve.network:23: IPMasquerade=yes is deprecated, and If the last record says "eth0: Gained network you are OK. |
If somebody still has DNS resolution issues than open \wsl\Fedora34\etc\systemd\resolved.conf file using any editor that preserves Linux EOL, read documentation inside (5 min), and configure DNS resolution according to guidelines and his/her desire. |
It seems lounching VSCode daemon messes things up Setup below helped me, thanks guys:
|
This issue was happening to me since yesterday, after I updated my Windows 11 to the latest version, 22H2.
Afterwards this is required as well, because of the system/wsl restarts/upgrades, etc:
|
Worked form me: get name server via |
For me, fix was rather simple, Network mode was set to public, and box "Block all incoming connections, including those in the list of allowed apps." was ticked. After it is unchecked, even auto-generated resolved.conf worked form me. |
Thanks! |
I've tried every enlisted here solution - nothing helps. The only solution which is helped me is this one: https://learn.microsoft.com/en-us/windows/wsl/troubleshooting?source=recommendations#wsl-has-no-network-connectivity-once-connected-to-a-vpn Generally, you just get the list of DNS servers used by your VPN via |
Guys, just try wsl-vpnkit. At least I can with it use WSL while on VPN. https://crapts.org/2022/05/17/wsl2-network-connectivity-when-using-a-vpn/ |
Any solution for that ? I've tried all these sugestions above but nothing works. |
My 2 cents
just create a bridged Hyper-V adapter and add these lines to .wslconfig
The properties are NOT documented yet (https://learn.microsoft.com/en-us/windows/wsl/wsl-config), but it made my day. |
In my environment, I found a 3rd party security software (e. g. |
In my case, I've disabled Internet Protocol Version 6 (TCP/IPv6) in WLAN Properties of Network Connections Settings. Configuration Screenshot: Ping github.com Successfully Screenshot: |
How is this still an issue? |
@crystalthoughts, this does not seem to be a single issue, but a collection of them, some already fixed, some not. Each and every one of my setups has performed fine since months ago, but there seem to be some specific setups still broken depending on the installed SW (VPN, AV, etc.) or network settings. |
This worked for me no problem! |
@ludzzz this resolved my issue , thanks |
Hi folks, we have put out a new update that aims to address networking issues in WSL. In your More info on this release and the changes can be found here in the blog post. Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2. |
This worked for me too, Windows 10 Build 19045, WSL2, Ubuntu 22.04 |
These new networking features are now available on the latest version of Win11 22H2! Please make sure you're on the latest build to get these features, you can do that by clicking "Check for Updates" in Windows settings. You can check you have the right build by either ensuring you have KB5031354 installed, or run |
Added
to my .wslconfig and DNS is now working. |
I tried the new mirrored networking mode, but Docker Desktop crashed after its first reboot, though everything else seemed to work properly. After that, I performed the factory reset encouraged by Docker Desktop and it worked fine until the next engine restart or system reboot instead. Then, the engine startup crashed once again, and so on. Furthermore, the Kubernetes feature did not even initialise for the first time, no matter how many restarts, factory resets or reboots I performed. Once Bearing in mind everything seemed to work flawlessly and blazing fast, but Docker Desktop, I'm not really sure whether this was a compatibility issue on the WSL side or on the Docker side instead. @craigloewen-msft, I'll be glad to provide any log you esteem necessary to ease the addressing of this issue if it is on the WSL side indeed, though I guess this could be somehow related to both #10494 and Docker#13686 Edit: Everything working flawlessly and blazing fast with Docker Desktop >=4.26.0, which added support for the new mirrored mode! 🥳🚀 |
Mirrored mode is definitely the way to go! For those who would like to understand how it works/why it's better: here's a decent article+video on it, and here's a link to the documentation. Mirrored mode has now moved from being an experimental feature to being a stable feature under the [wsl2] section. Another thing people should probably turn on for DNS issues caused by VPNs is the new dnsTunneling feature which communicates directly to the windows host to resolve hostnames instead of sending network packets which can be blocked or interfered with by VPNs. So DNS tunneling should help avoid network issues in WSL caused by VPNs. |
This worked for me
Source: https://askubuntu.com/a/1398053 |
I can confirm. This worked for me as well. |
This solution worked for me. But when I disconnect from the VPN and connect again, I have the same problem again and I have to repeat the whole process again and restart. Has it happened to anyone else? |
We suffer from the same issue. WSL2 looses network connectivity on certain cases like:
What we found out is that in case where the connectivity is lost, there are additional routes in the routing table in Windows attached to the VPN Adapter with the destination of the WSL Adapter (or more, the IP-Range of the WSL Adapter). If we remove this routes, the connectivity comes back immediately. Here is a script that lists all relevant routes regarding WSL (adjust the function main {
$adapterVpn = Get-NetAdapter -InterfaceDescription "<your adapter identifer>"
$adapterWsl = Get-NetAdapter -Name "vEthernet (WSL)"
$ipInfoVpn = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
$ipInfoWsl = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$wslCidr = "$($ipInfoWsl.IPAddress)/$($ipInfoWsl.PrefixLength)"
$ipInfoWslVm = wsl -- ip -o -4 -json addr list eth0 `
| ConvertFrom-Json `
| %{ $_.addr_info.local } `
| ?{ $_ }
Write-Host "=== VPN (ID $($adapterVpn.ifIndex)) ==="
Write-Host "IP: $($ipInfoVpn.IPAddress)"
Write-Host
Write-Host "=== WSL Adapter (ID $($adapterWsl.ifIndex)) ==="
Write-Host "IP: $($ipInfoWsl.IPAddress)"
Write-Host "MASK: $(convert-cidr-to-string -cidr $ipInfoWsl.PrefixLength) (/$($ipInfoWsl.PrefixLength))"
Write-Host
Write-Host "=== WSL VM ==="
Write-Host "IP: $($ipInfoWslVm)"
Write-Host
$routesWsl = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$routesVpn = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
Write-Host "=== Routes for the WSL Adapter ==="
$routesWsl | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
Write-Host "=== Routes for the VPN Adapter ==="
$routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix } | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
}
function convert-cidr-to-string {
param($cidr)
$shift = 64 - $cidr
[System.Net.IPAddress]$subnet = 0
$subnet = [System.Net.IPAddress]::HostToNetworkOrder([int64]::MaxValue -shl $shift)
return $subnet.IPAddressToString
}
function convert-cidr-range-to-address-string {
param($cidrNotation)
return $cidrNotation.split('/')[0]
}
function convert-cidr-range-to-mask-string {
param($cidrNotation)
return convert-cidr-to-string -cidr $cidrNotation.split('/')[1]
}
function is-cidr-in-cidr-range {
param (
[string] $cidrNotationRange,
[string] $cidrCurrent
)
$ip = convert-cidr-range-to-address-string $cidrCurrent
$min, $max = cidr-to-ip-range $cidrNotationRange
return ([version]$min) -le ([version]$ip) -and ([version]$ip) -le ([version]$max)
}
function cidr-to-ip-range {
param (
[string] $cidrNotation
)
$addr, $maskLength = $cidrNotation -split '/'
[int]$maskLen = 0
if (-not [int32]::TryParse($maskLength, [ref] $maskLen)) {
throw "Cannot parse CIDR mask length string: '$maskLen'"
}
if (0 -gt $maskLen -or $maskLen -gt 32) {
throw "CIDR mask length must be between 0 and 32"
}
$ipAddr = [Net.IPAddress]::Parse($addr)
if ($ipAddr -eq $null) {
throw "Cannot parse IP address: $addr"
}
if ($ipAddr.AddressFamily -ne [Net.Sockets.AddressFamily]::InterNetwork) {
throw "Can only process CIDR for IPv4"
}
$shiftCnt = 32 - $maskLen
$mask = -bnot ((1 -shl $shiftCnt) - 1)
$ipNum = [Net.IPAddress]::NetworkToHostOrder([BitConverter]::ToInt32($ipAddr.GetAddressBytes(), 0))
$ipStart = ($ipNum -band $mask)
$ipEnd = ($ipNum -bor (-bnot $mask))
# return as tuple of strings:
([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipStart)) | ForEach-Object { $_ } ) -join '.'
([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipEnd)) | ForEach-Object { $_ } ) -join '.'
}
main |
> We suffer from the same issue.WSL2 looses network connectivity on certain cases like:
What we found out is that in case where the connectivity is lost, there are additional routes in the routing table in Windows attached to the VPN Adapter with the destination of the WSL Adapter (or more, the IP-Range of the WSL Adapter). If we remove this routes, the connectivity comes back immediately. Here is a script that lists all relevant routes regarding WSL (adjust the function main {
$adapterVpn = Get-NetAdapter -InterfaceDescription "<your adapter identifer>"
$adapterWsl = Get-NetAdapter -Name "vEthernet (WSL)"
$ipInfoVpn = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
$ipInfoWsl = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$wslCidr = "$($ipInfoWsl.IPAddress)/$($ipInfoWsl.PrefixLength)"
$ipInfoWslVm = wsl -- ip -o -4 -json addr list eth0 `
| ConvertFrom-Json `
| %{ $_.addr_info.local } `
| ?{ $_ }
Write-Host "=== VPN (ID $($adapterVpn.ifIndex)) ==="
Write-Host "IP: $($ipInfoVpn.IPAddress)"
Write-Host
Write-Host "=== WSL Adapter (ID $($adapterWsl.ifIndex)) ==="
Write-Host "IP: $($ipInfoWsl.IPAddress)"
Write-Host "MASK: $(convert-cidr-to-string -cidr $ipInfoWsl.PrefixLength) (/$($ipInfoWsl.PrefixLength))"
Write-Host
Write-Host "=== WSL VM ==="
Write-Host "IP: $($ipInfoWslVm)"
Write-Host
$routesWsl = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$routesVpn = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
Write-Host "=== Routes for the WSL Adapter ==="
$routesWsl | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
Write-Host "=== Routes for the VPN Adapter ==="
$routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix } | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
}
function convert-cidr-to-string {
param($cidr)
$shift = 64 - $cidr
[System.Net.IPAddress]$subnet = 0
$subnet = [System.Net.IPAddress]::HostToNetworkOrder([int64]::MaxValue -shl $shift)
return $subnet.IPAddressToString
}
function convert-cidr-range-to-address-string {
param($cidrNotation)
return $cidrNotation.split('/')[0]
}
function convert-cidr-range-to-mask-string {
param($cidrNotation)
return convert-cidr-to-string -cidr $cidrNotation.split('/')[1]
}
function is-cidr-in-cidr-range {
param (
[string] $cidrNotationRange,
[string] $cidrCurrent
)
$ip = convert-cidr-range-to-address-string $cidrCurrent
$min, $max = cidr-to-ip-range $cidrNotationRange
return ([version]$min) -le ([version]$ip) -and ([version]$ip) -le ([version]$max)
}
function cidr-to-ip-range {
param (
[string] $cidrNotation
)
$addr, $maskLength = $cidrNotation -split '/'
[int]$maskLen = 0
if (-not [int32]::TryParse($maskLength, [ref] $maskLen)) {
throw "Cannot parse CIDR mask length string: '$maskLen'"
}
if (0 -gt $maskLen -or $maskLen -gt 32) {
throw "CIDR mask length must be between 0 and 32"
}
$ipAddr = [Net.IPAddress]::Parse($addr)
if ($ipAddr -eq $null) {
throw "Cannot parse IP address: $addr"
}
if ($ipAddr.AddressFamily -ne [Net.Sockets.AddressFamily]::InterNetwork) {
throw "Can only process CIDR for IPv4"
}
$shiftCnt = 32 - $maskLen
$mask = -bnot ((1 -shl $shiftCnt) - 1)
$ipNum = [Net.IPAddress]::NetworkToHostOrder([BitConverter]::ToInt32($ipAddr.GetAddressBytes(), 0))
$ipStart = ($ipNum -band $mask)
$ipEnd = ($ipNum -bor (-bnot $mask))
# return as tuple of strings:
([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipStart)) | ForEach-Object { $_ } ) -join '.'
([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipEnd)) | ForEach-Object { $_ } ) -join '.'
}
main This has worked very good for me the last couple of months, thank you Roemer! I have adjusted your script to be required to be ran as admin #Requires -RunAsAdministrator and to auto delete the routes it finds. function main {
$adapterVpn = Get-NetAdapter -InterfaceDescription "<your adapter identifer>"
$adapterWsl = Get-NetAdapter -Name "vEthernet (WSL)"
$ipInfoVpn = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
$ipInfoWsl = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$wslCidr = "$($ipInfoWsl.IPAddress)/$($ipInfoWsl.PrefixLength)"
$ipInfoWslVm = wsl -- ip -o -4 -json addr list eth0 `
| ConvertFrom-Json `
| %{ $_.addr_info.local } `
| ?{ $_ }
Write-Host "=== VPN (ID $($adapterVpn.ifIndex)) ==="
Write-Host "IP: $($ipInfoVpn.IPAddress)"
Write-Host
Write-Host "=== WSL Adapter (ID $($adapterWsl.ifIndex)) ==="
Write-Host "IP: $($ipInfoWsl.IPAddress)"
Write-Host "MASK: $(convert-cidr-to-string -cidr $ipInfoWsl.PrefixLength) (/$($ipInfoWsl.PrefixLength))"
Write-Host
Write-Host "=== WSL VM ==="
Write-Host "IP: $($ipInfoWslVm)"
Write-Host
$routesWsl = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
$routesVpn = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
Write-Host "=== Routes for the WSL Adapter ==="
$routesWsl | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
Write-Host "=== Routes for the VPN Adapter ==="
$routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix } | Format-Table `
@{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
@{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
@{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
NextHop
+ $toDelete = $routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix }
+ Write-Host "Routes to be deleted:"
+ Write-Host $toDelete
+ Remove-NetRoute -InputObject $toDelete -Confirm:$false
} |
#11002 change the value to 0x20 (hex) or 32 (decimal) to re-enable IPv6 |
Environment
Steps to reproduce
Install WSL2 with any Ubuntu distro(1804/2004) .Ping google.com or any other website. Tried on with/without VPN(Big Edge IP client).
WSL logs:
ping google.com
Temporary failure in name resolution
For sudo apt update
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Expected behavior
I should get reply to the ping. And Internet should be easily accessible from within WSL.
WSL 1 has no problem. I am able to connect to internet. When I try to use docker on WSL , it asks to upgrade to WSL2. So now i have no option. Just have to use WSL2 for docker where there is no internet connectivity
Actual behavior
Have looked at the solutions from other issues. None seems to works. Follows some that I have tried but it seems not to work.
Added ([network]generateResolvConf = false) to wsl.conf And add nameserver 8.8.8.8 in resolv.conf
Run the following powershell script
Please let me know how can i fix this issue, so i can connect to internet from my WSL
FYI Antivirus - McAffe and Windows Defender is enabled.
The text was updated successfully, but these errors were encountered: