microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.42k stars 823 forks source link

mDNS does not work with mirrored network mode #11852

Open lprobsth opened 3 months ago

lprobsth commented 3 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3880]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

networkingMode=mirrored

* Ping a device in the same network as the computer with its local hostname:

ping server.local


### Expected Behavior

WSL2 should correctly resolve the local / mDNS hostname to the correct IP address:

$ ping server.local PING 192.168.178.53 (192.168.178.53) 56(84) bytes of data. 64 bytes from 192.168.178.53: icmp_seq=1 ttl=64 time=3.98 ms 64 bytes from 192.168.178.53: icmp_seq=2 ttl=64 time=2.20 ms 64 bytes from 192.168.178.53: icmp_seq=3 ttl=64 time=2.81 ms


### Actual Behavior

The mDNS hostname is not resolved:

ping: server.local: Name or service not known



### Diagnostic Logs

[WslLogs-2024-07-29_18-57-01.zip](https://github.com/user-attachments/files/16416517/WslLogs-2024-07-29_18-57-01.zip)
github-actions[bot] commented 3 months ago

View similar issues

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!

Open similar issues:

Closed similar issues:

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

Diagnostic information
.wslconfig found
Detected appx version: 2.2.4.0

Revono commented 2 months ago

Same issue here WSL2 Ubuntu

Emaro commented 2 months ago

I have the same issue. A fix would be appreciated.

CatalinFetoiu commented 2 months ago

thanks for reporting the issue

we have updated the docs to include details about how to resolve .local names in WSL. Please refer to https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#resolve-local-names-in-wsl

let us know if you have any questions

lprobsth commented 2 months ago

I tried the configuration with libnss-mdns and nsswitch.conf from the docs but it does not work. Is there something else I can provide?

CatalinFetoiu commented 2 months ago

@lprobsth thanks for following up please make sure you are using latest WSL build (2.3.17) I recommend also confirming that mirrored mode was successfully enabled - you can do this by running "wslinfo --networking-mode" in your distro

if you still encounter issues after confirming the above, please collect networking logs using instructions at https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

lprobsth commented 2 months ago

I have installed WSL build 2.3.17. The problem seems to persist.

Here is the log file. The networking log script did not create an archive - so I zipped the output from the log directory. I hope this is correct.

WslNetworkingLogs-2024-08-22_16-09-18.zip

github-actions[bot] commented 2 months ago
Diagnostic information ``` .wslconfig found Detected appx version: 2.3.17.0 optional-components.txt not found ```
CatalinFetoiu commented 2 months ago

@lprobsth thanks

the logs don't show mdns traffic being sent by Linux

could you please collect and share the output of "sudo strace ping server.local" ? that might give us a hint on why no mdns requests are sent