You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux version 5.15.167.4-microsoft-standard-WSL2 (root@f9c826d3017f) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Tue Nov 5 00:21:55 UTC 2024
Distro Version
24.04
Other Software
On a fresh install of Windows 11 with WSL 2, local IP names ( e.g.: beanie.local) resolved correctly in PowerShell but not within WSL 2.
Steps Taken:
Works in PS not in WSL:
Attempted to ping beanie.local insode Powershell, ping succeeded.
Attempted to ping beanie.local inside WSL 2, but the ping failed.
Avahi Daemon - is this the problem?:
Installed and started avahi-daemon in WSL 2 to enable mDNS resolution.
Ran avahi-browse to check if the mDNS service was working, but the command hung and did not return any results.
Checked the avahi-daemon logs via journalctl and saw no errors during startup, but it didn't help with mDNS resolution in WSL 2.
Firewall Configuration - is this the problem?:
Attempted to enable mDNS by opening ports in Windows Firewall:
Inbound Port: Allowed UDP traffic on port 5353 for mDNS.
Outbound Port: Allowed outbound traffic on port 5353 for mDNS.
Despite these changes, mDNS resolution still didn’t work within WSL 2.
Manual Workaround - bummer...why is this so...frustrating?:
Edit /etc/hosts in WSL 2: As a workaround, manually added an entry for beanie.local in the WSL /etc/hosts file, mapping it to its IP address.
Configure /etc/wsl.conf: Adjusted DNS settings in /etc/wsl.conf to try to improve name resolution and restarted WSL after modifications.
Issue with mDNS Service in WSL 2:
Despite configuring avahi-daemon and adjusting firewall settings, mDNS still didn't resolve .local addresses within WSL 2.
The issue is that mDNS multicast packets are not natively supported in WSL 2, and avahi-daemon or similar services cannot fully resolve .local addresses.
Resolution:
While manual entries in /etc/hosts provided a workaround, the mDNS service didn't work as expected within WSL 2, even after opening the necessary ports. The firewall changes were tested (allowing inbound and outbound UDP traffic on port 5353), but they did not enable mDNS support in WSL 2.
Conclusion - Huh? Please help?:
The problem was temporarily fixed by:
Editing /etc/hosts: Manually adding an entry for beanie.local in WSL 2's /etc/hosts file, mapping it to the correct IP address.
**Editing /etc/wsl.conf: add the following entry to /etc/wsl.conf:
# [network]
# generateHosts = false
Request for Help on Stack Overflow:
Any advice on getting full mDNS support working inside WSL 2 would be greatly appreciated."
Repro Steps
see above..
Expected Behavior
ping beanie.local resolves without having to modify a hosts file. All locals just resolve.
Actual Behavior
ping beanie.local does nto resolve unless added to hosts file and 3 chickesn are spun clockwise over my head.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered:
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Once completed please upload the output files to this Github issue.
Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
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!
Facing the same issue, I have created a script to manually update etc/hosts and added it in .bashrc as an alias. This way whenever the ip changes for .local domain, I can update the etc/hosts file manually through command.
Windows Version
Microsoft Windows [Version 10.0.22631.4541]
WSL Version
2.3.26.0
Are you using WSL 1 or WSL 2?
Kernel Version
Linux version 5.15.167.4-microsoft-standard-WSL2 (root@f9c826d3017f) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Tue Nov 5 00:21:55 UTC 2024
Distro Version
24.04
Other Software
On a fresh install of Windows 11 with WSL 2, local IP names ( e.g.:
beanie.local
) resolved correctly in PowerShell but not within WSL 2.Steps Taken:
Works in PS not in WSL:
beanie.local
insode Powershell, ping succeeded.beanie.local
inside WSL 2, but the ping failed.Avahi Daemon - is this the problem?:
avahi-daemon
in WSL 2 to enable mDNS resolution.avahi-browse
to check if the mDNS service was working, but the command hung and did not return any results.avahi-daemon
logs viajournalctl
and saw no errors during startup, but it didn't help with mDNS resolution in WSL 2.Firewall Configuration - is this the problem?:
5353
for mDNS.5353
for mDNS.Manual Workaround - bummer...why is this so...frustrating?:
/etc/hosts
in WSL 2: As a workaround, manually added an entry forbeanie.local
in the WSL/etc/hosts
file, mapping it to its IP address./etc/wsl.conf
: Adjusted DNS settings in/etc/wsl.conf
to try to improve name resolution and restarted WSL after modifications.Issue with mDNS Service in WSL 2:
avahi-daemon
and adjusting firewall settings, mDNS still didn't resolve.local
addresses within WSL 2.avahi-daemon
or similar services cannot fully resolve.local
addresses.Resolution:
While manual entries in
/etc/hosts
provided a workaround, the mDNS service didn't work as expected within WSL 2, even after opening the necessary ports. The firewall changes were tested (allowing inbound and outbound UDP traffic on port 5353), but they did not enable mDNS support in WSL 2.Conclusion - Huh? Please help?:
The problem was temporarily fixed by:
/etc/hosts
: Manually adding an entry forbeanie.local
in WSL 2's/etc/hosts
file, mapping it to the correct IP address./etc/wsl.conf
: add the following entry to /etc/wsl.conf:Request for Help on Stack Overflow:
Any advice on getting full mDNS support working inside WSL 2 would be greatly appreciated."
Repro Steps
see above..
Expected Behavior
ping beanie.local resolves without having to modify a hosts file. All locals just resolve.
Actual Behavior
ping beanie.local does nto resolve unless added to hosts file and 3 chickesn are spun clockwise over my head.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: