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

blocking ads in host not working on Windows 11 #1851

Closed ziga89 closed 2 years ago

ziga89 commented 2 years ago

Hi Steven

Thank you very much for good work, i am using your host files for two years now i think, but now i updated to Windows 11 and blocking ads with host files not working anymore for me, do you maybe know why? Any option to conect on my PC and check it out?

Kind Regards Ziga

welcome[bot] commented 2 years 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 2 years ago

Hello Ziga @ziga89 thank you for this question.

This article has a good list of things to try on Windows:

https://serverfault.com/questions/452268/hosts-file-ignored-how-to-troubleshoot

Does this help?

ziga89 commented 2 years ago

Steven hi,

thank you for reaching me back, I tried this yesterday and no luck, don’t know what is happening, i have a problem since one week ago when i installed w11.

[DEBENEC_small.jpg] \

On Sat, Jan 1, 2022 at 20:27, Steven Black @.***> wrote:

Hello Ziga @.***(https://github.com/ziga89) thank you for this question.

This article has a good list of things to try on Windows:

https://serverfault.com/questions/452268/hosts-file-ignored-how-to-troubleshoot

Does this help?

β€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

ziga89 commented 2 years ago

Hi to all, Does anyone have time to connect on my PC to check it out? Maybe i am doing something wrong and i don't know what... It is so annoying to see those ads everywhere :)

StevenBlack commented 2 years ago

Some things to try Ziga @ziga89:

I hope this helps.

ziga89 commented 2 years ago

Steven hi,

tried that also dont work, i am using Opera browser, i tried in Edge also.

[DEBENEC_small.jpg] \

On Thu, Jan 6, 2022 at 19:28, Steven Black @.***> wrote:

Some things to try Ziga @.***(https://github.com/ziga89):

  • Clear your PC's DNS cache
  • Clear your browser cache (Have you tried with a different browser?)
  • If on Chrome, go to chrome://net-internals/#sockets and click "Flush socket pools".
  • If on FireFox, make sure "Enable DNS over HTTPS" is not active.
  • As with all things with Windows, a reboot fixes lots.

I hope this helps.

β€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

ziga89 commented 2 years ago

Screenshot 2022-01-06 194023

ads still there :(

dnmTX commented 2 years ago

If on Chrome, go to chrome://net-internals/#sockets and click "Flush socket pools".

That was removed long long ago πŸ˜‰

sockets

dnmTX commented 2 years ago

@ziga89 open Command Prompt(CMD) and type: nslookup wizhumpgyros.com If the result is:

Name:    wizhumpgyros.com
Address:  0.0.0.0

....means that the hosts file from here is in use and therefore nothing else can be done about it. If the result is the actual IP instead of zeroes,means that the hosts file is not in use and you need to figure this out on your end. Retrace your steps,you might missed something,who knows.

StevenBlack commented 2 years ago

Ziga @ziga89 is this a Windows 11 virtual machine? If so, how's that networking set up?

Are you using a VPN, of any sort, concurrently? Is Tor in the picture here?

ziga89 commented 2 years ago

Steven,

No Virtual Machine. I am having Hacken VPN - hVPN installed, but i installed it after i having a problem with hosts.

In the picture is Opera browser, i am using it for a two years now.

thank you very much. Ziga

[DEBENEC_small.jpg] \

On Fri, Jan 7, 2022 at 07:08, Steven Black @.***> wrote:

Ziga @.***(https://github.com/ziga89) is this a Windows 11 virtual machine? If so, how's that networking set up?

Are you using a VPN, of any sort, concurrently? Is Tor in the picture here?

β€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

ziga89 commented 2 years ago

[Screenshot 2022-01-07 092959.png]

I am getting this.. weird [DEBENEC_small.jpg] \

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, January 6th, 2022 at 21:33, dnmTX @.***> wrote:

@.***(https://github.com/ziga89) open Command Prompt(CMD) and type: nslookup wizhumpgyros.com If the result is:

Name: wizhumpgyros.com Address: 0.0.0.0

....means that the hosts file from here is in use and therefore nothing else can be done about it. If the result is the actual IP instead of zeroes,means that the hosts file is not in use and you need to figure this out on your end. Retrace your steps,you might missed something,who knows.

β€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

ziga89 commented 2 years ago

@StevenBlack @dnmTX guys i found the issue. I had .txt after the file name, this was the issue. Looks like i forgot this shouldn't be there. Thank you for your help!

All the best

ziga89 commented 2 years ago

not working again, i added this to my dns settings: https://www.quad9.net/service/service-addresses-and-features/ did a reset of PC and ads are here again. i did flush dns and not helping.

Lateralus138 commented 2 years ago

You said your file had the txt extension and you changed it and it worked and rebooted; after you rebooted have you checked the file's name again to see if something has renamed it again? If so, then remove the extension again and set the file read only, reboot and check again.

Edit: So, I've been doing a bunch of little tests and it seems now I'm having some issues as well. I'm looking into it and I have some ideas of what it could be, but I need to do quite a bit more tests and research before I'm sure, of course.

Lateralus138 commented 2 years ago

I've spent hours today doing all kinds of tests as I have lots of machines I'm responsible for protecting (sort of) and I've been worried about this. I'm usually in Linux, but most of the machines I maintain are Windows and I ignorantly assumed since it worked in Linux and since I only did basic checks on all the Windows machines that it should've worked on all the other's, but I had forgotten that on most of the other machines I had never run ipconfig or nslookup on any of them and only did basic checks in browsers (where I had forgotten I also had other ad blockers) and so , again, assumed everything was working fine.

Some of the tests I did at first was changing the amount of urls that were in the file and kept rebooting and doing browser checks and ip, nslookup checks to see if it was working. I would keep deleting more urls until I got somewhere, blocking was working, but then nothing would work after a few reboots. I then forgot I should've been flushing the DNS and rebooting the whole time and so I started doing that and then adding lines back and still it was inconsistent (I don't know how many times I've rebooted today). I then remembered having issues with svchost locking the hosts file some years ago and I thought to use an unlocker and unlocked the hosts file from svchost and then ran ipconfig /flushdns and now, even with all lines added back it's all working consistently now. svchost is constantly checking the file and you never know when it is so if you try and run flushdns it either stalls or doesn't actually complete it's job.

I now have all ip entries back in the file, have checked many of the urls without ad blockers to make sure they're blocked and everything is working great again. The key does seem to be a successful flush when the hosts file is not in use and then a proper flush of a browsers dns itself wouldn't hurt.

Steps I would take (some of which other's have mentioned here) is to:

The hosts file may need to be unlocked for every step you take (something like IoBit Unlocker or similar):

  1. Unlock (if necessary) and replace/update the hosts file.
  2. Unlock (ALWAYS just to make sure) and run ipconfig /flushdns in a command prompt. If it stalls in the cli it's probably locked again and you just keep unlocking until it's successfully runs. svchost accesses the hosts file so often you may need to do it several times.
  3. Flush your browser DNS if possible just in case.
  4. Reboot
  5. Check a random url from the hosts file with ping www.whatever.url -n 1 and/or nslookup www.whatever.url to make sure it's blocked and then a url that you know should work just to make sure it works.

Windows may suck for some people, but I guarantee it's far better than it used to be. I've dealt with it and it's network/hosts file for many years and the fact that I can successfully block 100k+ urls in the HOSTS file now is amazing. Just takes a small bit of work.

I'm going to start doing tests on all my other machines so it's going to take a few days to a week maybe (they're not all at my house), but I'm fairly sure this is a main issue and solution. As of now all 100k+ urls are being successfully blocked. I'll answer back here after I've done all my tests.

StevenBlack commented 2 years ago

Thank you so much for that Ian @Lateralus138. This is very helpful.

dnmTX commented 2 years ago

Yeah.....i'm fighting it too,on other fronts though due to my hosts lists are in my router but after updating to Win 10 21H2 it's been a constant struggle to configure it/tweak it. It's a real bitch(excuse the french)....indeed πŸ€”

P.S. @Lateralus138 there is a post/discussion here somewhere. A user with the same problems found a way to get the DNS Service removed from svchost,which i think where all the headache begins. If you can find that post,it's explained in details and the info is very helpful πŸ‘

Lateralus138 commented 2 years ago

Thanks @StevenBlack & @dnmTX, I'll be looking for that post soon.

I personally do not want to disable any NOP no matter if I like it or not, as in the end disabling things as M$ intended them to work will usually break something, somewhere, at some point in time, and half the time you don't even know what's broken until it's too late. We all know M$ has a habit of over-complicating things at the user's detriment, but then again no person or OS is perfect and as a computer oriented person these are only slightly irritating to me as I usually tend to solve everything I have issues with. I will probably try the way you mentioned in the post, but only for evaluation/testing.

I've since done some more tests and with all the flushing I was still having issues, but the last 3 times I've flushed the DNS and rebooted I was still having issues (no web pages were loading), but I left my computer on for a while and each time eventually (after I'm not sure how long, been sort of busy with my kids tonight) everything started loading perfectly fine and fast and stayed consistently good after then next few reboots.

So this is evidence to me that every time you reset/flush your DNS it reparses and processes the hosts file and then it must save it to a cache for quicker checking each time or something and therefore doesn't need to reparse every time after the flush so it doesn't take as long. M$ changes stuff so often it's hard to keep up really. I think I actually knew this years ago, but I have to admit I have very bad memory issues as I get older, but still have logic so I have to refigure things out all the time anymore.

Sorry for hijacking the OP's post, but I think this is all somewhat related and I'm just trying to help.

As I've said, I'll be doing more testing soon and work on a real solution, but I can't make any promises as to when. It will be soon I think though.

ziga89 commented 2 years ago

Hi to all,

i did clean install of OS today and everything is working now.

Thank you for collaborating,

StevenBlack commented 2 years ago

\o/ yes!

Closing!