-
Notifications
You must be signed in to change notification settings - Fork 822
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 stopped working in WSL2 after Windows 11 Pro update #11022
Comments
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:
|
I forgot to add that it happened on 2 windows computers after the same update. |
When running from Windows Power Shell ping works ok. From WSL2 no more. |
Are you sure this has anything to do with windows update? What do you have in |
Thank you @jtgoral. Can you try to put the following in %userprofile%/.wslconfig, then run: "wsl.exe --shutdown" to apply them:
And see if that solves the issue ? |
Yes, Adding the line to .wslconfig solved the problem on both computers: jacek@okno-galaxy:/mnt/c/Users/jacek/public_html/beer/beersmith2$ ping okno-t320.local |
Yes, it was caused by a Windows update. All tries to use avahi connections stopped working right after the update on two Windows boxes.. Computers I connect from WSL (*.local) are FreeBSD and EndeavourOS Linux. |
i also had this issue on the most recent version of Windows 11 Pro (as of 2024-06-14). the suggested fix worked for me as well. |
I can confirm that the workaround from @OneBlue worked for me too. |
I can also confirm that the upgrade broke this for me and what @OneBlue suggested fixed the issue. |
I used to be able to resolve names in the .local domain, but recently I encountered this issue.
# /etc/nsswitch.conf
-hosts: files mdns4_minimal [NOTFOUND=return] dns
+hosts: files dns mdns4_minimal (I am using WSL2 in NAT mode not Mirrored mode.) |
I just re-discovered this problem and fix of disabling DNS tunneling. It seems like a pretty significant regression in WSL2, for |
@CatalinFetoiu & @keith-horton - could you please take a look? |
I "solved" this by running a perl DNS server on a centos host on the same network, which calls
|
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 |
tl;dr: the new docs suggest turning off DNS tunneling and using mirrored networking mode. |
and (more constructively, it would be great if there were a header list of the common issues, and if that section linked to something on how to change the networking mode!) |
@NelsonMinar if you use mirrored networking mode you can also keep DNS tunneling enabled |
I will say that the description of
|
@shaver please make sure to follow the steps from https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#resolve-local-names-in-wsl, section "networkingMode set to Mirrored" (make sure to update WSL to the latest pre-release build (2.3.17) and do the configuration mentioned in the docs for enabling mdns in Linux) |
@CatalinFetoiu should I open a separate bug for the lag? Happy to do so! |
@shaver thanks for testing the fix and following up yes, please feel free to open a separate issue for the delay you observed |
@s73v3r thanks for following up can you please share the output of sudo strace -ff ping ender6printer.local? |
i ended up with custom code to find ip address. because i have wifi and wifi hot-spot both connected to another pc. i tried mirror mode but i cannot make a ping to global network again. my laptop is window11 home.
|
This solution fixed it for me. |
I have the following in my .wslconfig file
I even restarted my computer to be sure but I still have issues pinging .local addresses from WSL (it works from powershell).
UPDATE I am wondering if the problem is linked to IPV6 because I can directly ping the IPV4 address but not the IPV6 address from WSL and I think the name resolution returns the IPV6 address. Ping from Powershell using:
Ping from WSL using:
|
@YAmikep in order to have IPv6 connectivity in WSL you need to enable mirrored mode - you need to add "networkingMode=mirrored" in your wslconfig file if you do that, you no longer need to disable DNS tunneling in order to resolve .local names but you need to follow the steps documented at https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#resolve-local-names-in-wsl (install libnss-mdns and configure /etc/nsswitch.conf) to enable Linux to use mDNS queries let us know know if you have any questions |
Thank you @CatalinFetoiu I will try this but I'm also interested in making things work in the NAT mode. Any idea why disabling DNS tunneling does not fix it like it did for some people? |
@YAmikep I see, thanks for following up. Please collect networking logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 from the case with NAT mode and dnsTunneling=false and we can take a look |
Ok thanks, I am going to try to collect these logs. |
@YAmikep if you are in NAT networking mode, you don't need to install those, but you need to disable DNS tunneling if you are in mirrored networking mode, you can install libnss-mdns and configure /etc/nsswitch.conf as shown in https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#resolve-local-names-in-wsl |
I use Ubuntu 24.04.1 as my distribution and have found the following solution without using avahi-daemon and libnss-mdns. Make the following adjustments in the files mentioned #.wslconfig #/etc/wsl.conf [network] Do not forget to restart the WSL with wsl.exe --shutdown for the adjustments to take effect. In order to have systemd/resolved use mdns, two more steps are necessary:
The activation of mDNS for the individual interfaces can then be checked with the command resolvectl mdns. |
note: I added just this line and that was enough, ubuntu 24, wsl2, win11pro 24h2 |
Same for me, got the issue after win11pro 24h2 udpate. Added the line in comment above and now it works again. |
Windows Version
Microsoft Windows [Version 10.0.22635.3061]
WSL Version
2.1.0.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.137.3-1
Distro Version
Ubuntu 23.10
Other Software
No response
Repro Steps
ping okno-t320.local does not find okno-t320
Expected Behavior
jacek@okno-galaxy:~$ ping 192.168.68.115
PING 192.168.68.115 (192.168.68.115) 56(84) bytes of data.
64 bytes from 192.168.68.115: icmp_seq=1 ttl=63 time=7.53 ms
64 bytes from 192.168.68.115: icmp_seq=2 ttl=63 time=5.69 ms
64 bytes from 192.168.68.115: icmp_seq=3 ttl=63 time=6.20 ms
^C
--- 192.168.68.115 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 5.689/6.472/7.533/0.777 ms
Actual Behavior
jacek@okno-galaxy:
$ ping okno-t320.local$ping: okno-t320.local: Name or service not known
jacek@okno-galaxy:
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: