-
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
Can't resolve ".local" (mDNS) hosnames #384
Comments
mDNS resolution on Ubuntu is normally provided by Avahi. But the following doesn't work:
dbus doesn't work due to #376 . Unfortunately, I haven't been able to reproduce the segfault while running under strace. Nor under gdb, which just hangs and/or otherwise behaves badly. |
Oooh, I just hit this one. It was quite a head-scratcher! I'm curious as to whether there's been any progress on this :o |
On one of the latest builds:
From the output above, we can see few blocking issues here. Those would be; support for the socket option |
This also makes it impossible to run certain configurations of |
I hit this while trying to do some work on my pi powered quadrupeds. Back to using my mac terminal. |
Lack of Avahi support in WSL makes it difficult to use WSL/WIndows PCs in teaching labs with increasingly ubiquitous Raspberry PI and the like in engineering education. |
@scivision - I looked into this a bit. As explained previously, there were two blocking issues.
After stubbing (1) (because there is no support from Windows networking stack), implementing (2) and few other minor changes, it seems like
I will get the PR out and try to get this in time for Fall Creators Update. If you look at the |
This should be fixed in 16273 |
Confirm upgrading to the latest Windows Insider Preview build (1709 build 16288.1) fixed SO_REUSEPORT related issue for me. Thanks |
@sgrebnov - Thanks for confirming. I am marking this issue closed. If it persists after upgrading to 16273, please let us know and we can reopen it. |
So I understand that we consider this bug "fixed," but I was wondering if the functionality described above will ever be implemented. It would be very cool for mDNS / ZeroConf to actually work on WSL. |
I suspect it already is; just not on port |
the title of this issue is "can't resolve '.local' (mDNS) hostnames" and not "can i listen on port 5353." i'm asking if we'll ever be able to resolve .local (mDNS) hostnames. |
That's a fair question- I read your "above" ambiguously because this issue morphed immediately into " The issue title is likely a Windows ask not a WSL ask. Effectively, your ask is this. If you have a compliant mDNS service that is serving up [In the interest of completeness, if WSL had its own virtualized ethernet network devices |
no. mDNS already works on Windows 10. in fact, my work around is to use cmd.exe to do the resolution with a command like i assure you, my request is for mDNS name resolution to work on WSL. |
And I assure you, if it doesn't work, that would be a great new issue submission. But it would need a repro with a concise set of CLI repro steps on both the win32 side and the WSL side that identified a diverge in behaviour in WSL versus say a Real Linux Ubuntu in a VM connected to the same mDNS service on Windows. Which no one (that I am aware of) has looked into. |
scroll up to the top of this page. aseering gives an example of the behaviour on native linux and then an example on WSL. note that the two systems behave differently despite the same software being installed. aseering mentions another issue (issue #18), but as I have stated, this is not what i'm talking about. I'm talking about how WSL can't resolve ".local" (mDNS) hostnames. This is independent of the ping utility. There is also a dependency on dbus working. If it needs to be fixed before this bug can be resolved, then it should be fixed and both this issue and issue #376 should remain open until they are fixed. Are you really saying this bug was closed because no one can demonstrate mDNS resolution fails in WSL but does not fail under Windows 10? Because this is EXACTLY what this issue demonstrates. Perhaps someone should look into it. |
On Native Linux mDNS services are normally provided by Avahi. As you assured me, your request is for mDNS name resolution to work on WSL, not the Avahi mDNS service. It is not the same software installed. One is Avahi. One is the Windows 10 mDNS service.
There are no known outstanding issues with dbus in WSL. If you find any problems with dbus, please feel encouraged to open a new issue describing the diverge.
I am really saying: that if it doesn't work, that would be a great new issue submission. But it would need a repro with a concise set of CLI repro steps on both the win32 side and the WSL side that identified a diverge in behaviour in WSL versus say a Real Linux Ubuntu in a VM connected to the same mDNS service on Windows. |
My problem (and I'll pour through this and other posts again) is that I have code I've written that works on Linux (Ubuntu and Arch) and Mac OS X. Both the Python code and C# code work fine on Linux and Mac OS X. I am now working with someone else's Windows 10 box, and, wanting all my regular tools , cranked up WSL a la Ubuntu, and cannot get the code to resolve the "*.local" stuff that works in the other two OS's. (If I recall correctly, CygWin did not suffer from this lack of understanding the last time I tried such a thing, but that was many moons ago.) |
I really think this issue should be reopened. It would be great if WSL handled mDNS out of the box, or if one simply had to edit: I'm still seeing this issue on build 17134.286, any assistance is appreciated. |
Thank you I will monitor there. |
It's not just WSL, mDNS .local name resolution stops working on windows x64 randomly throughout the whole OS. It definitely DOES work sometimes but then other times stops. I haven't found out why or when. I use PowerShell to SSH into a mac box, and sometimes it's .local address works, and other times it doesn't. This is on two different Windows boxes. Additionally, none of the other non Windows devices have any problem with mDNS .local addresses. |
This still doesn't seem to work. OS build 18362.356 |
This is still an issue, please reopen. I am able to use cmd.exe to ping a |
@LeviSchuck: Indeed, I have the same issue on latest Windows. |
@sunilmut This is still not working in Version 10.0.17763 Build 17763 |
Build 18363 has this same problem too, I can't resolve |
How about trying this?
|
@ma2shita That works, but it's not a workaround when I'm trying to use Ansible to provision machines, for example.
|
It also refutes Microsoft's position that "it is impossible to do mDNS in WSL because the WinNT side does mDNS" - if PowerShell can do mDNS, then they should be able to replicate that functionality as a resolver. I am reminded that Microsoft has a long history of favoritism. I mean, it's not surprising that they want you to use WinNT instead of WSL, but they should at least stop saying they're "a Linux Company" or that they support Linux. WSL is a toy, meant to demonstrate the functionality of their hypervisor (which, admittedly, is pretty cool if you want to run WinNT). They clearly have no interest in making a useful product. As much as I groan every time I have to slog through the AWS console, I'm happy to stick with AWS if this is how they support Linux. |
It's understandable why avahi does not work out-of-the-box, but this doesn't mean that the issue is resolved. The issue presented in the first entry could be solved without avahi, e.g. by adding the mDNS entries to /etc/hosts by WSL, or providing the mapping in any other way. Manually translating hostname to IP will not work if TLS is involved and certificate is issued for the .local domain name. Likewise, SSH may complain. If not by default, does anyone know if there is a (linux-side) service that can be installed, that interfaces WinNT side to query mDNS resolution? |
Btw., is this issue also on WSL 2? |
This issue ended up dupe #376 and fixed in 16273, because that was the first (but not the only) blocker on |
To get .local mDNS hostnames working on WSL 1, I ran the following:
If I leave out
For me this is only working over IPv4, and not over IPv6. |
Just to confirm, this works for WSL2, now I'm able to access Windows from WSL. After running the above steps, the following now works:
|
That works as well in my setup, but the WSL can only reach the host machine, no other devices in network. PS> ping batterytester.local
Pinging batterytester.local [10.0.0.9] with 32 bytes of data:
Reply from 10.0.0.9: bytes=32 time=19ms TTL=255
Reply from 10.0.0.9: bytes=32 time=34ms TTL=255
Reply from 10.0.0.9: bytes=32 time=55ms TTL=255
Reply from 10.0.0.9: bytes=32 time=74ms TTL=255
Ping statistics for 10.0.0.9:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 19ms, Maximum = 74ms, Average = 45ms
PS> wsl.exe
🐧 ping batterytester.local
ping: batterytester.local: Name or service not known
🐧 ping "$(hostname).local"
PING KGrzeg-pc.local (172.19.176.1) 56(84) bytes of data.
64 bytes from 172.19.176.1 (172.19.176.1): icmp_seq=1 ttl=128 time=0.287 ms
64 bytes from 172.19.176.1 (172.19.176.1): icmp_seq=2 ttl=128 time=0.328 ms The device is pingable via IPv4 address. I have no idea how to fix it. |
I too have this exact behaviour you describe, and I can ping mDNS devices by their IP from the WSL2 instance but nothing by .local. To add to it my use case is: On dedicate Ubuntu device i can do: Avahi will respond with a list of devices. Running the same command in WSL2 returns nothing at all. Anyone have any updates on this? |
#11022 - seems to be a current incarnation of this, with a work around. |
I have an existing stock Ubuntu server on my network. Let's say its hostname is "my-server". (The following should work with a stock Mac as well; not sure about Windows servers?)
If I open up a regular Command Prompt, I can do the following:
But from Bash-on-Windows:
For comparison, from a real Ubuntu machine on the same network, I can do:
Granted,
ping
wouldn't work even if it could resolve the name due to #18 , but other tools likecurl
orssh
would work if appropriate services were running on the server. I'm just trying to post a minimal reproducer.The text was updated successfully, but these errors were encountered: