Open taythebot opened 2 years ago
I'm having exactly the same problem, hosts get filled up with the same IP and hostname over and over again, hundreds of times.
here is the example
Anyone have a fix for this?
I had the same problem, and it was because the service is looking for your hosts in the /etc/hosts file on the vm, not on the Windows file. And for some reason, my VM /etc/hosts file wasn't updated automatically, so it was adding again and again new lines.
I had to create / add content to this file on the VM : /etc/wsl.conf
[network]
generateHosts = true
You have to restart your linux instance after adding the fil. In powershell :
Restart-Service LxssManager
It did the trick for me.
Edit : Well no, I still have duplicate entries coming :(
Yes I tried it but it's still happening :/
same problem here, numerous entries in my hosts file except mine looks like this:
wsl.local # alias: Ubuntu; managed by wsl2-host
custom.domain # alias: Ubuntu; managed by wsl2-host
wsl.local # alias: Ubuntu; managed by wsl2-host
custom.domain # alias: Ubuntu; managed by wsl2-host
wsl.local # alias: Ubuntu; managed by wsl2-host
custom.domain # alias: Ubuntu; managed by wsl2-host
wsl.local # alias: Ubuntu; managed by wsl2-host
custom.domain # alias: Ubuntu; managed by wsl2-host
wsl.local # alias: Ubuntu; managed by wsl2-host
custom.domain # alias: Ubuntu; managed by wsl2-host
... and so on ...
Also, it's not consistent in adding entries from the ~/.wsl2hosts
file (like "custom.domain" in my example above) - sometimes it's there, next time it's commented out ...
I'm running Windows 11 with WSL2 (Kernel version: 5.10.102.1) In Event Viewer I see the following:
failed to get IP for distro "Ubuntu": exit status 1
info messagesfailed to get IP for distro "Ubuntu-22.04": exit status 1
info messagesGetDefaultDistro failed: exit status 1
error messagesI have two different Ubuntu distros & Ubuntu-22.04
is the default - not sure if that messes things up
lmk if you need more troubleshooting data...
So I have Glasswire installed and it tells me whenever the hosts file is changed. Every hour I will get a notification that it has been modified by this program. The IP addresses don't seem to change at all, but it's commenting out the old entries and creating new ones. At the end of each day, I'll have around 20-30 commented out lines.
Is there some way to prevent this behavior?