-
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
/etc/hosts does not update #2059
Comments
Please fill out the issue template. It looks like you are running a build that does not add windows hosts to the /etc/hosts file. |
Sorry, it's Ubuntu 16.04.2 LTS / Microsoft Windows [Version 10.0.15063] |
No worries. The functionality of adding windows hosts to /etc/hosts is currently only available in Insider builds. |
Oh. That was a 2016 comment and since I am on Creator's Update I thought it's already in. Nevermind then! Any workarounds? (cp when bash starts :) ? ) |
@chx , your suggestion works for me... I'm doing this (in my .bashrc):
Just have to log out/in after any changes. |
For whoever ends up on this page for having the issue on the recent versions of windows. I 'm on Ubuntu 18.04 on
and I have
in /etc/wsl.conf, but the files was not being regenerated when I was closing all the session. |
@AsharLohmar - The files are updated when the session is launched, not when it exits. |
AFAIK, the file is regenerated when the first session is started (might be wrong), that's why I mentioned that I was was closing all the sessions. The check it self was to fire up a new shell/session and |
@AsharLohmar - To ensure a new session is created you must terminate any running ones (wsl.exe --terminae ) |
Didn't know that, thanks, I usually use |
There is also the option to open the Windows Power Shell and run one of the following commands (no need to restart windows) |
The generated file seems to not be an exact copy of the Windows hosts file, but also includes some lines added by the distro, in my case Ubuntu. Can anybody tell me how these additional entries are generated/where they are stored? I want to add |
I changed
C:\Windows\System32\drivers\etc\hosts
, verified in an already open powershell window that the change is picked up. Then closed my bash window (no other bash windows are open) and upon restart, the new entry was not added. I have# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
in my/etc/hosts.
. I read #890 (comment) but it didn't help.The text was updated successfully, but these errors were encountered: