.local / mDNS doesn't work when localias runs inside wsl2
lumosminima opened this issue · 2 comments
I'm using WSL2 and was previously just starting my dev servers with 0.0.0.0 and adding firewall allow rules to access the server on my phone using machine local IP: 192.168.1... but needed https for some app features and the readme here mentions mDNS magic which I don't know what it is but currently I can't access .local domains from phone, localias mentions mDNS: serving ui.local
. On actual machine where I run the localias everything works I can resolve ui.local
is there something extra needed for it to work also how will my android phone know that ui.local means that it is that specific machine with WSL2 it needs to connect to when it doesn't have any special DNS entry like how the main machine running the localias does?
On actual machine where I run the localias everything works I can resolve ui.local is there something extra needed for it to work also how will my android phone know that ui.local means that it is that specific machine with WSL2 it needs to connect to when it doesn't have any special DNS entry like how the main machine running the localias does?
Unfortunately, broadcasting mDNS rules from inside of a WSL2 container don't seem to "make it out" to other devices on the network. I haven't been able to figure out why this is or make it work myself. I will update the README to make this clear — I'm sorry that this confused you.
Some related reading that I've found:
- https://nelsonslog.wordpress.com/2022/01/06/mdns-hostname-local-and-wsl2/
- https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking
- This makes me think that maybe Mirrored Mode networking will fix the issue, but I haven't tried this yet.
- https://learn.microsoft.com/en-us/windows/wsl/networking#dns-tunneling
- This might also solve the problem; I haven't tried it yet either.
- microsoft/WSL#11022 (comment)
- https://stackoverflow.com/questions/64763147/access-a-localhost-running-in-windows-from-inside-wsl-2
I added a section to the documentation clarifying this problem, and I'll keep this issue open until someone figures out how to fix it.