Browsers are using 100% of the CPU because of the HOSTS file

Discussion in 'Windows 8' started by rEApEAt, Mar 1, 2016.

  1. rEApEAt

    rEApEAt MDL Senior Member

    Jan 5, 2011
    355
    168
    10
    #1 rEApEAt, Mar 1, 2016
    Last edited: Mar 1, 2016
    My main machine had a hardware issue, so I'm trying Windows 8.1 Enterprise in another machine.

    When I install my HOSTS file, all browsers (Firefox, Chrome, Opera, Explorer, SeaMonkey) begin to use between 96% and 100% of the CPU. Tor, for obvious reasons, is the only exception. The problem disappear when I revert to the default (empty) HOSTS file. The DNS Client service is disabled as it should be when a large HOSTS file is used.

    Changing all entries from 127.0.0.1 to 0.0.0.0 does not work.

    I never had this problem (or any other problem whatsoever) with my HOSTS file while I was using previous Windows versions.

    Please note that I'm not wanting to start a discussion about the pertinence of using a HOSTS file. I just want to keep using my HOSTS file (as I always did) in Windows 8.1 Enterprise. Any help will be appreciated.


    EDIT: I'm not using Windows Defender.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    #2 sml156, Mar 1, 2016
    Last edited: Mar 1, 2016
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. rEApEAt

    rEApEAt MDL Senior Member

    Jan 5, 2011
    355
    168
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. bpwnes

    bpwnes MDL Member

    Aug 11, 2015
    151
    27
    10
    Correct me if I'm wrong, but if you're going to run HostsServer you still have to run HostsMan (configured to use HostsServer), right? I haven't set it up since XP days for those customers that keep infecting their machines over and over no matter how hard you lock it down. We started installing HostsMan w/ HostsServer and combined it with Avira Free (customly configured) and they stopped coming back with viruses. I kinda miss taking their money. I guess the problem with fixing computers very well is they can't break it and stop coming back to pay you more money. :/
     
  5. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    Most people that use HostsMan to block ads and some malicious sites do run HostsServer as a service but no you do not have to use HostMan,

    When you block sites with the hosts file even though that site is redirected to your computer the browser tends to keep searching your computer for whatever is blocked ( usually a picture or something similar ) until it times out.

    Using HostsServer it sends a 200 ( means "ok I received that" in internet talk ) to your browser and the site which speeds up page loads.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    #6 sml156, Mar 2, 2016
    Last edited: Mar 3, 2016

    I would use HostsMan to

    1. scan the hostsfile
    2. Scan for Duplicates
    3. Delete comments

    If that doesn't seem to fix it I would manually scan the file with Notepad or something similar, Pain in the ass I know because your hosts file is probably 80 thousand line's but I would just press the page down key without letting go to look for a huge block of screwed up entrees
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. rEApEAt

    rEApEAt MDL Senior Member

    Jan 5, 2011
    355
    168
    10
    I download updates from many sources (actually, all of them) and HostsMan scans for duplicates automatically at every update. Anyway, I ran both scans and everything's alright with the file.

    One thing I know for sure: there's something (beyond Windows Defender, which is disabled) in Windows 8.1 that does not let me use my HOSTS file like I did in previous operating systems. Ok, I have disabled some useless services (for a home user), but I used to do this since XP and I always did it with care. Anyway, I have even re-enabled some of them, but it doesn't worked.

    Application Management
    BranchCache
    Certificate Propagation
    Client for NFS
    Distributed Link Tracking Client
    DNS Client
    Family Safety
    Internet Explorer ETW Collector Service
    Netlogon
    Offline Files
    Remote Procedure Call (RPC) Locator
    Remote Registry
    Sensor Monitoring Service
    Smart Card
    Smart Card Device Enumeration Service
    Smart Card Removal Policy
    SNMP Trap
    Superfetch
    Windows Biometric Service
    Windows Location Framework Service
    Windows Media Player Network Sharing Service
    Windows Defender

    Well, I had an idea and I'm smelling a solution. I will test it and I'll be back soon.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    #8 sml156, Mar 3, 2016
    Last edited: Mar 3, 2016
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. rEApEAt

    rEApEAt MDL Senior Member

    Jan 5, 2011
    355
    168
    10
    Well, it should not be relevant, but... remember what I said?

    The solution consisted in using HostsMan to build a brand new HOSTS file:

    hosts.png

    But why the old HOSTS is so large compared with the new one? And why it's not a good idea to keep a HOSTS file for so many time as I did?

    I don't know how much the ads servers change their addresses. As far as I can see, they barely change. But it is obvious that evil servers (those used for scam, phishing, spread malware and so on) come and go very quickly. And this is probably a good reason to start from scratch a new HOSTS file after a while.

    However, it's important to stress that the previous (large) HOSTS file, which was been maintained since the XP era, never ever induced to any problem while I was using it in XP or in Windows 7 (even when using less RAM memory). So yes, this is indeed a Windows 8 / 8.1 issue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. bpwnes

    bpwnes MDL Member

    Aug 11, 2015
    151
    27
    10
    Well Microsoft did rip out a ton of legacy code when they wrote Windows 8. I wonder if they removed something that's affecting the archaic hosts file...
     
  11. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    #11 sml156, Mar 3, 2016
    Last edited: Mar 3, 2016
    I doubt it

    The hosts file does - one thing and one thing only - and it does it very efficiently with less resources and faster than any other DNS lookup or add blocker out there.

    Since the beginning of time any OS (Dos,BSD,Linux,OSX,Windows and more) that is net capable has a hosts file located somewhere and the odds of that changing anytime soon is slim to nil.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. sml156

    sml156 MDL Member

    Sep 8, 2009
    123
    62
    10
    #12 sml156, Mar 3, 2016
    Last edited: Mar 3, 2016
    My only guess would be that your hosts file got corrupted with illegal characters that your text editor cannot display.

    From ~60MB to ~2MB seems unlikely to be illegal characters I know, But over the years using different versions of editors and copy paste from different types of programs who knows
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. rEApEAt

    rEApEAt MDL Senior Member

    Jan 5, 2011
    355
    168
    10
    It's a good guess. However, as I said, I only use HostsMan (to update and manage exclusions) and Notepad2, which is very well behaved.

    Anyway, I did a test copying the "big" file to a XP (x86) virtual machine - with much less processing power and memory - with no adverse effects.

    hosts-xp.png

    BTW, I checked the encoding of the HOSTS file. It is ANSI, which seems to be normal. Windows 8.1 really seems to be the culprit in some way.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...