Closed ghost closed 2 weeks ago
Hello! Thank you for opening your first issue in this repo. It’s people like you who make these host files better!
Hello @cieres thank you for this.
Are there any Windows users experiencing this, or something similar?
Hello, I am experiencing the same issue. If I were to reboot after updating my hosts file, explorer.exe would be completely frozen and my internet connection fails. I did not realize that this hosts file change was the cause, so I ended up reinstalling Windows 10 entirely thinking it was NordVPN's software. When the same issue occurred on my new installation, I reverted my hosts file to blank and it resolved the issue.
EDIT I get what I deserve for not reading the readme. Upon viewing the readme, I realized I did not disable DNS caching per the provided instructions. Upon disabling this caching, the issue appears to have gone away.
I reverted my hosts file to blank and it resolved the issue.
A blank hosts
will cause other problems, though, so don't make it totally empty.
How do I fix this? My laptop is totally frozen on startup.
Restart in safe mode, then remove all the hosts in the host file. Might need to right click in the start menu and open cmd in admin to modify it, cant remember.
My file says that localhost is handled in DNS, so I ain't totally sure if it's necessary, but it sure won't hurt to have the basic localhost lines in there:
127.0.0.1 localhost
::1 localhost
Windows 11 user here. Having the same crippling slow down for the first 5 minutes of rebooting the machine. DNS Client Network Service takes up only about 10% CPU, RAM, but querying sites clearly doesn't work, the whole explorer process is heavily taxed (search bar, file navigation, system tray barely respond), and many other startup apps hard crash.
Assuming this is related to the large size of the hosts file and the DNS cache service on Windows, as mentioned in the README.
I had the DNS caching service turned off for a couple years and the mostly-default hosts file here worked fine. Had to re-enable caching because WSL2 installed from the Microsoft Store crashes otherwise (see this comment). My current solution is to use one of the much smaller ~2000-line hosts files instead.
Windows 11 user here. Having the same crippling slow down for the first 5 minutes of rebooting the machine. DNS Client Network Service takes up only about 10% CPU, RAM, but querying sites clearly doesn't work, the whole explorer process is heavily taxed (search bar, file navigation, system tray barely respond), and many other startup apps hard crash.
Assuming this is related to the large size of the hosts file and the DNS cache service on Windows, as mentioned in the README.
I had the DNS caching service turned off for a couple years and the mostly-default hosts file here worked fine. Had to re-enable caching because WSL2 installed from the Microsoft Store crashes otherwise (see this comment).
Ah. Seems I've finally found a solution to this annoying boot issue, but would have to give up WSL2 in the future. Guess I'll take it for now.
This seems related to #411 . In that case, the --compress
option should help (but not totally solve the issue given the current huge list of domains)
This seems related to #411 . In that case, the
--compress
option should help (but not totally solve the issue given the current huge list of domains)
how exactly do you use this option?
I usually generate the hosts file following this option, running the command with the following flags
python3 updateHostsFile.py -b -k -c -m -e <extensions you want to include>
(-c
is the short for --compress
)
The command generates a new hosts file that contains up to 9 domains per line, improving the loading time on Windows.
Thanks @stefanopini, the compressed hosts file works for me!
Sharing my experiment so far as I faced similar issues (especially during Windows startup). PC Spec: Windows 10 22H2; AMD Ryzen 5 5600X; 48GB RAM;
I faced similar issues (especially during Windows startup), such as:
Initially I always generate hosts file with --extensions porn fakenews gambling --compress
parameters enabled. This generates 234,203 entries for me. Then I tried removing porn
extensions, and regenerate to get 187,322 entries.
This works for me during startup, I had faster turnaround for 'network internet icon'.
My conclusion here is that my system still can handle hosts entries about 170k-180k.
I also tried turning off / disabling DNS client. Using 234,203 entries, windows startup has no issues - 'network internet icon' shows up connected immediately.
Problem occurs when I started Google Chrome / MS Edge Chromium. CPU peaks almost immediately at 100%.
Chrome background service: Utility Network Service
is showing very high CPU utilization.
When using Firefox, I didn't encounter high cpu utilization.
Summary / Bottomline:
compress
option is a must for WindowsI have the same issues when I want to block all Windows domaine, but I have blocked windows using linux firewall on this time with iptables.
had the same issues. windows 10 with DNS cache service disabled, seems unusable. Browsers/IM run CPU usage through the roof every 10 seconds. I'll try the compressed version and see how this fares. (i7-4700K). Also since I use WSL2, I cannot actually disable DNS cache.
Are there any stripped limited versions? I've used stephen black's list for years without issues, but I have not updated it for a couple of years and now that I updated it, it seems the size has gone through the roof.
...it seems the size has gone through the roof.
Tasos @pshlos46 I agree, I'm well aware of the issue. One of our source lists is responsible for most of that growth. That said, that source is very diligent and responsive.
The real issue here is, Windows is a dumpster fire. No other OS has these problems. Considering Windows' bloat, the irony is not lost on me.
@StevenBlack of-course I agree 100% that Window's way of handling this, is the problem here and not the large hosts file. However, and without wanting to sound disrespectful as I know and understand what a load of work is to maintain and expand this through the years, I will provide some feedback.
samsungcloudsolution.net
that I stumbled upon in the comment section of a gist. I might suggest that the unified list now might be very strict? And create a lot of issues in tv's/mobile devices etc? I think there might be some value in providing a smaller more "mobile/smart-tv/appliance" friendly list, that still manages to block several of the main ads/threats in the internet but without crippling a lot al this new stuff that has to "phone home"Just my ideas and feedback. Thanks a lot for all your work through the years. :)
I have the same issue on Windows 11 with taskbar disappearing, also the internet is gone, seems like due to DNS.
Running the BAT file there was error that Python's request
library is not installed.
I think the BAT script should not run at all detecting the absence of such third party library on Windows.
The taskbar doesn't load on restart.
This could be fixed by running the below manually although the internet will still be gone:
task kill /f /im explorer.exe
start explorer
I just ran the disable-dnscache-service-win.bat
script, and seems like it restored the taskbar and the internet after the requested reboot.
Running the BAT file there was error that Python's request library is not installed.
Open cmd and run python -m pip install requests
.
I did that but the error isn't gone for some reason even though the package is installed.
3 iyn 2023, Ş. 21:03 tarixində iam-py-test @.***> yazdı:
Running the BAT file there was error that Python's request library is not installed.
Open cmd and run python -m pip install requests.
— Reply to this email directly, view it on GitHub https://github.com/StevenBlack/hosts/issues/2138#issuecomment-1575133989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHI3Z5T3QSMIFUK7UGT7Z3XJOC7PANCNFSM6AAAAAAR6NPIYA . You are receiving this because you commented.Message ID: @.***>
Did you try it in an Admin command prompt?
Of course
3 iyn 2023, Ş. 21:29 tarixində iam-py-test @.***> yazdı:
Did you try it in an Admin command prompt?
— Reply to this email directly, view it on GitHub https://github.com/StevenBlack/hosts/issues/2138#issuecomment-1575148208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHI3Z2UFALXRF3J376FITTXJOGBNANCNFSM6AAAAAAR6NPIYA . You are receiving this because you commented.Message ID: @.***>
I have no idea. Maybe there is more than one version of Python installed and the script is using that?
I have no idea. Maybe there is more than one version of Python installed and the script is using that?
No, that's not the case, there is only one Python version on my system.
I think there should be a notice that StevenBlack/hosts
(ie. the Python script and friends) is buggy and therefore dangerous under Windows somewhere in README
.
I had to delete my hosts
from Safe Mode (else it's not deletable as being used elsewhere
) to un-froze my PC, and to reach Safe Mode I had to find my BitLocker recover key. It's a long numeric key Windows requires to enter before accessing its Safe Mode.
I think I need to restore DNS Cache back now, I see that 4
is set in the bat file (disable-dnscache-service-win.bat
) as the registry key value, but what was the initial (default) value to restore?
I have no idea. Maybe there is more than one version of Python installed and the script is using that?
No, that's not the case, there is only one Python version on my system.
I think there should be a notice that
StevenBlack/hosts
(ie. the Python script and friends) is buggy and therefore dangerous under Windows somewhere inREADME
.I had to delete my
hosts
from Safe Mode (else it's not deletable asbeing used elsewhere
) to un-froze my PC.I think I need to restore DNS Cache back now, I see that
4
is set in the bat file (disable-dnscache-service-win.bat
) as the registry key value, but what was the initial (default) value to restore?
For those suffering the same issue after disabling DNS Cache, here's the service values to restore:
https://www.itprotoday.com/windows-78/jsi-tip-0324-registry-entries-services
From my experience, however great, this shouldn't be used under Windows by the general public esp. by those with lesser technical proficiency, else you'll render your system useless.
I cannot use this hosts file, it locks up my win10 machine, luckily I have an app unlocker unlock the hosts file to edit the hosts file back to 127.0.0.1 localhost.
I also disabled dns cache but I found I need that enabled to access my nvidia shield over smb.
Not much StevenBlack can do... Complain to M$ that their operating system seems unable to handle HOSTs files over a certain size (other operating systems can manage it so it's clearly possible) or use something like PiHole, AdGuard Home/Windows which can block ads & handles this HOSTs file properly.
Not much StevenBlack can do... Complain to M$ that their operating system seems unable to handle HOSTs files over a certain size (other operating systems can manage it so it's clearly possible) or use something like PiHole, AdGuard Home/Windows which can block ads & handles this HOSTs file properly.
ima get a rasberry pi and go with pi-hole and in need of a PI, prices are insane from shortage facepalm. i dont want to use a spare pc just to run ubuntu n pi hole, energy costs.
Not much StevenBlack can do... Complain to M$ that their operating system seems unable to handle HOSTs files over a certain size (other operating systems can manage it so it's clearly possible) or use something like PiHole, AdGuard Home/Windows which can block ads & handles this HOSTs file properly.
i grabbed the rpi 8GB new $75, just got back in stock. https://www.adafruit.com/product/4564
I usually generate the hosts file following this option, running the command with the following flags
python3 updateHostsFile.py -b -k -c -m -e <extensions you want to include>
(
-c
is the short for--compress
)The command generates a new hosts file that contains up to 9 domains per line, improving the loading time on Windows.
dude holy crap
finally decided to try this out, because at this point, Windows was taking more than half an hour to become usable after booting due to the Hosts file. It just took under 30 seconds with the compressed Hosts file. Thank you so much!
EDIT: and I can actually update the HOSTS file while Windows is running without booting into Safe Mode. Takes less than 30 seconds to be able to use the internet again.
I feel this issue has also been resolved. Unless I'm missing something, all of this stemmed from a misunderstanding/slow adoption of the --compress
argument. Unfortunately, I'm sure Windows users will continue to create issues for this over time, despite it already being documented in the README.
Thank you @ScriptTiger I agree!
Closing.
I added the raw file to my hosts and made the windows taskbar to not work. Start menu is grayed out, cant right click or anything with it. I tried removing the "Windows 10" section of the file, but it didnt work either. Idk which specific domain is doing it.