-
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
HOSTNAME.local: Name or service not known #10077
Comments
same problem here |
wsl2, Ubuntu-22.04 ping "$(hostname).local" |
Anything new? This used to work but doesn't now (WSL 2.0.0/WSL 2.0.1). Edit: oh, well, it seems to be simple - just install "libnss-mdns" with its dependencies. |
I have installed libnss-mdns on Ubuntu 22.04 and $ dpkg -l|grep libnss-mdns
ii libnss-mdns:amd64 0.15.1-1ubuntu1 amd64 NSS module for Multicast DNS name resolution
$ ping "$(hostname).local"
ping: MYCOMPUTERNAME.local: Name or service not known |
sudo apt install avahi-daemon libnss-mdns
sudo systemctl enable --now avahi-daemon and then make sure that libnss-mdns is enabled in $ cat /etc/nsswitch.conf
# uninvolved config portion skipped here...
#
# now, make sure that `mdns4_minimal [NOTFOUND=return]` exists and goes after `files`
hosts: files mdns4_minimal [NOTFOUND=return] dns after that mdns support should be set up and ready if you want to test it out using $ ping ${hostname}.local
PING egor-bychin-pc.local (172.28.0.1) 56(84) bytes of data.
^C
--- egor-bychin-pc.local ping statistics ---
21 packets transmitted, 0 received, 100% packet loss, time 20800ms as you can see, the address was resolved just fine (and the ip address is $ ping 172.28.0.1
PING 172.28.0.1 (172.28.0.1) 56(84) bytes of data.
^C
--- 172.28.0.1 ping statistics ---
23 packets transmitted, 0 received, 100% packet loss, time 22891ms |
Windows Version
Microsoft Windows [Version 10.0.22621.1555]
WSL Version
1.2.5.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.90.1
Distro Version
Debian Testing (bookworm), imported
Other Software
N/A
Repro Steps
Imported Debian Testing from Docker container rootfs.
/etc/wsl.conf:
/etc/resolv.conf:
/etc/hosts:
/etc/nsswitch.conf:
Finally, when trying to ping Windows side of host (ICMP traffic enabled) it does not work:
but
nslookup
gives:I guess this is because mDNS query is forced (leaking) through to DNS server running for WSL adapter?
Also,
works fine and resolves to correct IP (using that as workaround for now).
Without any further changes same command (
ping HOSTNAME.local
) works as desired on Ubuntu installed from MS Store:Is there any specific library/software that needs to be installed or configuration need to be changed in imported distribution to make this work? My workflow relies on being able to hit Windows host from WSL2 guest.
Expected Behavior
HOSTNAME.local resolves to Windows side of host.
Actual Behavior
HOSTNAME.local cannot be resolved.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: