-
Notifications
You must be signed in to change notification settings - Fork 809
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
Os Build: 18945 Can't access local development via domain name in hosts file #4356
Comments
Hello. We are facing similar problem with wsl2 ports mapped to [::1] and not to 127.0.0.1 cause some of our libraries can't work with ipv6. |
Is there a way to represent this in the hosts file? |
@scrossan-crown You can do this in your hosts file
|
@Drakota I have tried that but it didn't work for me |
@scrossan-crown |
doesn't work for me
|
@Drakota's solution works in 19018 |
This works: 127.0.0.1 test.loc www.test.loc Yes, it works now but it is so slow. In WSL 1 loading websites under localhost was really fast but WSL 2 is too slow in this topic. I'm using apache2 + PHP and loading of websites is horrible. Ajax requests are slow too. Website is stored in /mnt/c/webserver |
It is necessary to move website to linux directory etc /home/username and then website is really fast now. But it would be nice to have same speed in /mnt/c |
@ZdenekKrcal For WSL 2, it is necessary to move it to a Linux partition. IIRC they are also working on improving this. |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
I love that
localhost
has been implimented in 18945 but we also need maping to127.0.0.1
for use with the hosts file as this still isn't working so I still need to get the ip address each time i boot or shutdown wsl.The text was updated successfully, but these errors were encountered: