Skip to content
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

Hosts file should not be used on Windows 10, will break Internet #87

Open
jerkstorecaller opened this issue Feb 25, 2021 · 4 comments
Open

Comments

@jerkstorecaller
Copy link

jerkstorecaller commented Feb 25, 2021

Windows nearly chokes on hosts files of 1MB, and it seems this issue is exponential, because blockconvert's 50MB hosts file appears to break Windows perpetually.

If you put the 50MB hosts file in c:/windows/system32/drivers/etc/hosts, the DNS Client service will begin using 25% CPU perpetually. No DNS lookups will work. You can't even open the start menu to search for a program because apparently that relies on network lookups too.

  • You cannot replace/revert your changes to the hosts file, because it's locked by the haywire DNS Client service
  • You cannot stop the DNS Client service to free the lock, because Microsoft has a whole class of services that they don't even let you stop anymore even if you are admin. You will get "Access Denied" if you try this.
  • You cannot go to Services and disable the DNS Client service so it doesn't launch at startup. Microsoft prevents you from disabling this service even if you are an admin.
  • You cannot reboot in Safe Mode with Command Prompt and revert the hosts file, because Windows shows you the default files in c:/windows/system32/drivers/etc/hosts in safe mode, not the 50MB one. I don't understand this one, I'm sure a more experienced Windows user can explain how to fix this. (Oh, and did I mention I needed to use a Bitlocker recovery key to enter Safe Mode? As if it wasn't annoying enough.)

A working fix if you opened this can of worms:

  1. open regedit, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache, and change the value of the Start key from 2 to 4, then reboot. (Note: now a difference service will begin using 100% CPU, WinHTTP Proxy whatever, ignore it)
  2. Now the DNS Client shouldn't be running. Open a command prompt with admin rights, replace the hosts file (you kept a backup right?). Create an empty file if you have to.
  3. In regedit, change the Start value back to 2, and reboot. You should be back to normal.

What a joke of an OS.

mkb2091 added a commit that referenced this issue Feb 25, 2021
@mkb2091
Copy link
Owner

mkb2091 commented Feb 25, 2021

Really sorry you had to go through that. I've added a warning next to the download link.

Would booting into a different OS allow you to edit and repair the file without needing to enter safe mode?

@jerkstorecaller
Copy link
Author

jerkstorecaller commented Feb 25, 2021

Possibly, I don't know.

The SecureBoot security feature makes it non-trivial to boot into a different OS. I failed to boot a Ubuntu from USB. To achieve this I had to disable Bitlocker (Windows' built in full-disk-encryption that is enabled by default these days, and which also integrates SecureBoot).

To disable Bitlocker (which btw I also had to do when I tried rebooting in Windows safe mode to remove the hosts file), you can't just go in UEFI and change asetting. After you do this, you will be asked to enter the decryption key, which is saved on Microsoft's website. So gotta go on a different computer, go to https://aka.ms/recoverykeyfaq, log in with MS account (not sure how people without a Microsoft account can do it), write down a huge decryption key, enter it on the target Windows computer.

mkb2091 added a commit that referenced this issue Aug 12, 2021
@ThisNekoGuy
Copy link

Is opening as empty for me for some reason; is there a reason why?

@ThisNekoGuy
Copy link

@mkb2091
I was going to use this via AdAway on Android but I can't because it was emptied as part of a CSS commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants