Skip to content
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

Updates to /etc/hosts file not mapping ip address to to domain #5969

Closed
mrispoli24 opened this issue Sep 22, 2020 · 3 comments
Closed

Updates to /etc/hosts file not mapping ip address to to domain #5969

mrispoli24 opened this issue Sep 22, 2020 · 3 comments

Comments

@mrispoli24
Copy link

mrispoli24 commented Sep 22, 2020

Expected behavior

When updating my windows \etc\hosts file the updates copy over into WSL2 just fine and appear in /etc/hosts. I should then be able to go to mynewhostname:3000 (or whatever port) and see the running application.

Actual behavior

When I got to localhost:3000 in a browser this works but when I got to mynewhostname:3000 it does not find the running application. I haven't been able to find any basic documentation on why this is. I have tried restarting all services from powershell and also the entire machine. The new host continues to be copied over fine but the browser does not recognize this. Feels like localhost is just a proxy for the IP address of WSL but then how can I proxy my new hostname to that IP address?

It's worth noting this only seems to be an issue with WSL2. Using WSL1 everything works as expected.

@therealkenc
Copy link
Collaborator

/dupe #4851

@ghost
Copy link

ghost commented Sep 22, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Sep 22, 2020
@ghost ghost added the duplicate label Sep 22, 2020
@mrispoli24
Copy link
Author

mrispoli24 commented Sep 23, 2020

Thank you for those that are frantically googling and land here this is what worked from that issue: #4851 (comment)

::1 yourdomain.whatever instead of 127.0.0.1 yourdomain.whatever I left both in the windows host file as well and all works as expected.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants