Skip to content
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

WSL 2.0.9 update breaks DNS resolution and prevents connectivity including pings and downloads #10900

Closed
1 of 2 tasks
DrSAS opened this issue Dec 10, 2023 · 11 comments
Closed
1 of 2 tasks
Labels

Comments

@DrSAS
Copy link

DrSAS commented Dec 10, 2023

Windows Version

Microsoft Windows [version 10.0.22621.2715]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-1

Distro Version

Debian 11

Other Software

VSCode

Version: 1.85.0 (user setup)
Commit: af28b32d7e553898b2a91af498b1fb666fdebe0c
Date: 2023-12-06T20:48:09.019Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

Repro Steps

Notice all DNS-related activities are not functioning, including:

  • Failure when running curl -m 5 -v https://microsoft.com.
  • Inability to download any packages or files.
  • Unsuccessful pings to known IP addresses, such as ping 8.8.8.8.

Expected Behavior

WSL should resolve DNS requests and allow for standard internet connectivity for downloads and responses to pings to known IPs, consistent with pre-update functionality.

Actual Behavior

After the update to WSL version 2.0.9, the subsystem fails to resolve DNS requests. This issue is highlighted by the inability to use curl for downloads, connect to external services, or even ping external IP addresses, such as Google's public DNS at 8.8.8.8. The issue persists even after updating to WSL version 2.0.14, with no rollback options available.

Please note i don't have VPN or Proxy enabled.

curl -m 5 -v https://microsoft.com
* Could not resolve host: microsoft.com
* Closing connection 0
curl: (6) Could not resolve host: microsoft.com

ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 172.18.1.9 icmp_seq=1 Destination Host Unreachable
From 172.18.1.9 icmp_seq=2 Destination Host Unreachable
From 172.18.1.9 icmp_seq=3 Destination Host Unreachable
(...)

Diagnostic Logs

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@DrSAS
Copy link
Author

DrSAS commented Dec 10, 2023

I've followed the workaround suggested in this comment and #10494 (comment) and it appears to have resolved the DNS resolution problem for now.

To summarize, modifying the .wslconfig file allowed me to fix the DNS / ping problem, and editing the file in Docker allowed me to correctly access the ports of my containers with the mirrored networking mode.

@chanpreetdhanjal
Copy link

Hi. Can you please collect networking logs by following the instructions below?
https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@lancechant
Copy link

Hi @chanpreetdhanjal I am having similar issues, here are the attached logs
WslLogs-2023-12-12_08-23-45.zip

@chanpreetdhanjal
Copy link

Please follow the networking diagnostic script. https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

It should create a folder like [WslNetworkingLogs-date_ver.zip]

@lancechant
Copy link

Hi @chanpreetdhanjal sorry here are the network logs
WslNetworkingLogs-2023-12-14_08-00-13.zip

@CatalinFetoiu
Copy link
Collaborator

CatalinFetoiu commented Jan 12, 2024

@lancechant thanks for attaching the logs.

It looks like the IP of the WSL NAT vNIC got deleted and now the vNIC has a different IP than what Linux expects (Linux will use as DNS server and default gateway an IP that is no longer on the vNIC, causing the loss of connectivity).

Can you please do the following to collect additional diagnostics?
Run .\collect-networking-logs.ps1 -RestartWslReproMode
Wait for the script to output "Log collection is running", then start WSL
Confirm the issue reproduces
Stop the script and attach the resulting zip archive

Also, please run the following commands in an admin powershell window and attach "hns_events.log" to the issue

$events = Get-WinEvent -ProviderName Microsoft-Windows-Host-Network-Service | Where-Object { $_.TimeCreated -ge ((Get-Date) - (New-TimeSpan -Day 1)) }

($events | ForEach-Object { '{0},{1},{2},{3}' -f $_.TimeCreated, $_.Id, $_.LevelDisplayName, $_.Message }) -join [environment]::NewLine | Out-File -FilePath "hns_events.log" -Append

Additionally, can you try setting networkingMode=mirrored in the wslconfig file and let us know if the issue still reproduces?

Thanks

@lancechant
Copy link

Hi @CatalinFetoiu the issue I had seems to be fixed in 2.0.14. Also if I am correct the networkingMode=mirrored isn't available on windows 10?

@CatalinFetoiu
Copy link
Collaborator

CatalinFetoiu commented Jan 16, 2024

@lancechant thanks. In case you hit the issue again, please collect a new set of logs using command
.\collect-networking-logs.ps1 -RestartWslReproMode

you can ignore my instructions about collecting "hns_events.log", as that file is automatically collected by the latest version of the script

Regarding mirrored mode - you are correct, it is not available on Windows 10

@CatalinFetoiu
Copy link
Collaborator

closing since the issue did not reproduce. please open a separate issue if you are still encountering the problem. thanks

@omarbenabdejlil
Copy link

Here is how to fix the issue :
Press Windows + R on your keyboard : and put "optionalfeatures"

Disable then enable the wsl feature .
Restart the machine and your problem will be resolved !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants