StevenBlack / hosts

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
MIT License
25.71k stars 2.15k forks source link

Windows 10 taskbar doesnt work #2138

Open ghost opened 1 year ago

ghost commented 1 year ago

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.

welcome[bot] commented 1 year ago

Hello! Thank you for opening your first issue in this repo. It’s people like you who make these host files better!

StevenBlack commented 1 year ago

Hello @cieres thank you for this.

Are there any Windows users experiencing this, or something similar?

githubplanetarparrot commented 1 year ago

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.

rautamiekka commented 1 year ago

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.

Mustaf2501 commented 1 year ago

How do I fix this? My laptop is totally frozen on startup.

ghost commented 1 year ago

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.

rautamiekka commented 1 year ago

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
dshemetov commented 1 year ago

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.

MultiKoopa commented 1 year ago

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.

stefanopini commented 1 year ago

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)

MultiKoopa commented 1 year ago

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?

stefanopini commented 1 year ago

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.

dshemetov commented 1 year ago

Thanks @stefanopini, the compressed hosts file works for me!

sudarpo commented 1 year ago

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;

With DNS Client enabled

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.

With DNS Client disabled

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:

mrajema commented 1 year ago

I 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.

pshlos46 commented 1 year ago

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.

StevenBlack commented 1 year ago

...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.

pshlos46 commented 1 year ago

@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.

  1. It might be good to have a clear warning in the README for Windows users up top or something, that the unified hosts list with 180+k entries, will freeze their PC, so to act preemptively by disabling DNSCache (and that this will disable WSL2 and might create high CPU with some browsers). I used to recommend this list in the past in a lot of friends/family etc. that were not computer savvy in a "just copy and paste the hosts" and it worked, I won't do that now, but I think it had a lot of value for them even back when it had 40-50k entries.
  2. I setup PiHole with the default list (the unified one) and I noticed that i.e. Samsung SmartTV Youtube was not working even though I've whitelisted almost everything in the FAQ section of PiHole. Turns out I had to whitelist something from 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. :)

rwp0 commented 12 months ago

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.

iam-py-test commented 12 months ago

Running the BAT file there was error that Python's request library is not installed.

Open cmd and run python -m pip install requests.

rwp0 commented 12 months ago

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: @.***>

iam-py-test commented 12 months ago

Did you try it in an Admin command prompt?

rwp0 commented 12 months ago

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: @.***>

iam-py-test commented 12 months ago

I have no idea. Maybe there is more than one version of Python installed and the script is using that?

rwp0 commented 12 months ago

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?

rwp0 commented 12 months ago

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.

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:

image

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.

jekv2 commented 10 months ago

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.

iam-py-test commented 10 months ago

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.

jekv2 commented 10 months ago

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.

jekv2 commented 10 months ago

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

MultiKoopa commented 9 months ago

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.