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

mDNS does not work with mirrored network mode #11852

Open
1 of 2 tasks
lprobsth opened this issue Jul 29, 2024 · 10 comments
Open
1 of 2 tasks

mDNS does not work with mirrored network mode #11852

lprobsth opened this issue Jul 29, 2024 · 10 comments
Labels

Comments

@lprobsth
Copy link

lprobsth commented Jul 29, 2024

Windows Version

Microsoft Windows [Version 10.0.22631.3880]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  • Install WSL2 with Ubuntu
  • Enable mirrored network mode:
# Settings apply across all Linux distros running on WSL 2
[wsl2]

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

Copy link

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
Copy link

Revono commented Aug 14, 2024

Same issue here WSL2 Ubuntu

@Emaro
Copy link

Emaro commented Aug 14, 2024

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

@CatalinFetoiu
Copy link
Collaborator

CatalinFetoiu commented Aug 14, 2024

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
Copy link
Author

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
Copy link
Collaborator

@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
Copy link
Author

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

Copy link

Diagnostic information
.wslconfig found
Detected appx version: 2.3.17.0
optional-components.txt not found

@CatalinFetoiu
Copy link
Collaborator

@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

@johnp789
Copy link

I'm using systemd and systemd-resolved in my Ubuntu WSL2 distribution, and resolvectl showed that mDNS is disabled for the eth0 interface. As a workaround, I did this:

cat  << EOF | sudo tee /etc/systemd/network/10-eth0.network
[Match]
Name=eth0

[Network]
MulticastDNS=true
EOF

sudo networkctl reload

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