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.62k stars 2.14k forks source link

DNS Client overloaded when using biggest host file, causing "permanent" internet connection loss #2620

Closed Master-64 closed 1 month ago

Master-64 commented 1 month ago

When using a KVM, I've noticed that using one of the massive host files will end up essentially bricking the Windows 10 DNS Client application service that runs in the background. This in turn causes noticeable software slowdown across the entire system, and also prevents any and all proper internet connections. Due to how the DNS Client is bricked, it prevents all writing to the host file, and it never gets resolved (+ what seemed like a memory leak was occurring, alongside a considerable amount of CPU usage, leaving this client running for hours never fixed itself). Manually closing the DNS Client seemed to not allow the host file to be reverted, so you'd essentially be stuck without internet if you were an average user.

The only method I was able to use to recover the DNS Client from essentially bricking the system's NAT was to use the registry editor to prevent the DNS Client service from being automatically ran, then clearing the hosts file.

I'm unsure whether the KVM is causing the issue (as it virtualizes the NAT) or whether it's a separate issue.

My test bench ran on Windows 10 10.0.19045 Build 19045, using this repository's Release 3.14.62, using this host file: https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts

welcome[bot] commented 1 month 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 month ago

Thank you for this @Master-64.

Have you read Warning: Using this hosts file in Windows may require disabling DNS Cache service in our readme file?

As far as I can tell, this is all documented, yes?

Lateralus138 commented 1 month ago

I'm busy today so I just dropped in to point you in the right direction with an actual solution: compress the hosts file. The DNS Cache service can not handle that many line entries (and contrary to popular belief it's not the file size that's the issue, but the number of lines to process). I actually have a tool to do so as suggested in the 'Interesting Applications' section of Steven's README (I have both the script version and an actual command line program; I recommend the latter at it is exponentially faster and has more options). See 'Hosts Compress' - Windows version in the aforementioned section of the README of this repository. I'll be back with more information later if necessary. With this method there's no need to disable DNS caching and the hosts file will still block all redirected Urls.

Master-64 commented 1 month ago

Thank you for this @Master-64.

Have you read Warning: Using this hosts file in Windows may require disabling DNS Cache service in our readme file?

As far as I can tell, this is all documented, yes?

You are correct, this is my mistake for looking past. I figured it was an issue with the operating system itself, and it having issues with processing that many lines. As I believe there is nothing else to comment on since a solution to this issue has already been addressed with two different methods, I'll be closing this issue.

Lateralus138 commented 1 month ago

@Master-64 Fair warning that if you use the disabling DNS cache method then things like WSL will not be accessible.