hosts File

Discussion in 'Windows 10' started by solo_voyager, Feb 12, 2021.

  1. solo_voyager

    solo_voyager MDL Junior Member

    Joined:
    Aug 5, 2009
    Messages:
    58
    Likes Received:
    13
    Trophy Points:
    0
    Just tried to access my hosts file to make some changes.
    First thing I notice is that there are a huge number of new entries to the file.
    Many of these entries are locations I have not been able to make contact with for a long time.
    I tried to add an entry.
    I am stopped being told that I do not have permission.

    I am the administrator for this PC.
    I should have access to anything and everything.
    I tried to remove all the new entries and am stopped.
    Again saying that I do not have access.

    I play some games, then I'm able to make some changes, but then I'm told that the file is in use and I can't make any changes, same game just different rules.

    I do some more checking and find that I'll probably be able to make changes in Safe Mode.
    Little doubt that will work, but what is going on here?
    Why has the hosts file suddenly become so difficult to work with?
    Can I fix it and get it back to working like it used to?
     
  2. endbase

    endbase MDL Guru

    Joined:
    Aug 12, 2012
    Messages:
    4,522
    Likes Received:
    1,602
    Trophy Points:
    150
    Just copy teh host file to the desktop modify it and copy back and overwrite easy solution if it still works
     
  3. solo_voyager

    solo_voyager MDL Junior Member

    Joined:
    Aug 5, 2009
    Messages:
    58
    Likes Received:
    13
    Trophy Points:
    0
    HostsMan also cannot make any changes.
    The file being in use is the same reason given.
    @endbase
    Yeah, I've seen that one too.
    But if it does work, it's still simply just a workaround.
    It doesn't fix the problem.
    HostsMan's trouble leads me to believe that you're suggestion will probably work just as well.
    Someone or something is messing with my PC, trying to control my usage of it.
    I don't like it and want it stopped.
     
  4. TubFarter

    TubFarter MDL Novice

    Joined:
    May 18, 2017
    Messages:
    29
    Likes Received:
    8
    Trophy Points:
    0
  5. solo_voyager

    solo_voyager MDL Junior Member

    Joined:
    Aug 5, 2009
    Messages:
    58
    Likes Received:
    13
    Trophy Points:
    0
    What you folks don't seem to realize is that as long as the file is locked because another process is using it, it is locked even to an administrator.
    The only way around it I can see is in safe Mode while that process has not been activated yet.
    That doesn't fix the problem.
    We're still only talking workarounds.
     
  6. endbase

    endbase MDL Guru

    Joined:
    Aug 12, 2012
    Messages:
    4,522
    Likes Received:
    1,602
    Trophy Points:
    150
    What is causing the host file to be in use I never had that problem to be honest are you using thirth party program that uses the host file?
     
  7. drew84

    drew84 MDL Addicted

    Joined:
    Mar 13, 2014
    Messages:
    956
    Likes Received:
    1,491
    Trophy Points:
    30
    #7 drew84, Feb 12, 2021
    Last edited: Feb 12, 2021
    ... sure your host file hasn't by chance been made read only

    some Anti Virus/Firewalls software (like Zone Alarm) also lock the host file by default, needs to be unchecked in settings
     
  8. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,566
    Likes Received:
    59,628
    Trophy Points:
    450
  9. EXO56

    EXO56 MDL Member

    Joined:
    Mar 22, 2013
    Messages:
    149
    Likes Received:
    209
    Trophy Points:
    10
    #9 EXO56, Feb 12, 2021
    Last edited: Feb 12, 2021
    ...
    (removed because not understood by some addicted case sensitive noobs!)
     
  10. case-sensitive

    case-sensitive MDL Addicted

    Joined:
    Nov 7, 2013
    Messages:
    798
    Likes Received:
    283
    Trophy Points:
    30
    JFC Theres some crass ' Answers ' here .

    2 problems = Whats adding things to the host file and whats blocking it .

    Look at your anti virus and firewall and see if its being blocked . For example zonealarm does it .

    When did your problem start ?

    Have you got a back up from before it started ? If not why not :)

    Which IPs are being blocked ?

    Some keygens add things to the hosts file .

    Did you do malware scans ?
     
  11. TubFarter

    TubFarter MDL Novice

    Joined:
    May 18, 2017
    Messages:
    29
    Likes Received:
    8
    Trophy Points:
    0
    No it's not. I can open mine in notepad++, type any thing I want, click to save it and it will prompt me to open Notepad++ as administrator and still have the changes I made shown. I then click save and that's it. I can then open it with regular Notepad and it will show said changes.

    So there's something else going on if you cannot open/edit/save it with a text editor as administrator.
     
  12. drew84

    drew84 MDL Addicted

    Joined:
    Mar 13, 2014
    Messages:
    956
    Likes Received:
    1,491
    Trophy Points:
    30
  13. sml156

    sml156 MDL Member

    Joined:
    Sep 8, 2009
    Messages:
    175
    Likes Received:
    93
    Trophy Points:
    10
    I edit my hosts file all the time -- just use notepad++ and save it then notepad++ asks if you want to switch to adimin when it restarts save it again done now get on with your day
     
  14. EXO56

    EXO56 MDL Member

    Joined:
    Mar 22, 2013
    Messages:
    149
    Likes Received:
    209
    Trophy Points:
    10
    Yeah indeed "theres some crass answers here"!!!
    Blocking or adding/redirecting/resolving hostnames is the same approach!
     
  15. sml156

    sml156 MDL Member

    Joined:
    Sep 8, 2009
    Messages:
    175
    Likes Received:
    93
    Trophy Points:
    10
    Copy paste your hosts file to this forum let us look at it, If it's malicious we will tell you
     
  16. case-sensitive

    case-sensitive MDL Addicted

    Joined:
    Nov 7, 2013
    Messages:
    798
    Likes Received:
    283
    Trophy Points:
    30
    He already knows that its maliceous because he didnt change it and he cant change it .

    The best idea so far came from Drew84

    @ Problem ......... Time it :) = How long you spend trying to sort the problem out ............. against how long it would take to delete your system and reinstall it .
     
  17. ohenry

    ohenry MDL Member

    Joined:
    Aug 10, 2009
    Messages:
    133
    Likes Received:
    63
    Trophy Points:
    10
    I have had similar problems with trying to change the HOSTS file. A couple of things that might help. From a command prompt,

    attrib -R c:\windows\system32\drivers\etc\HOSTS

    Try making a copy somewhere else, edit the copy, and then use File Explorer to copy the edited file back to the original location.

    If all else fails, reboot. I have found several times that immediately after a reboot I can accomplish things that simply would not work before.

    A friend of mine, one of the best unix admins I have ever had the pleasure of working with, told me once that he wanted to put an icon on all of the companies PCs (approximately 50k Windows desktops worldwide). The icon would be labeled, "FIX ALL PROBLEMS", and would simply reboot the PC.
     
  18. solo_voyager

    solo_voyager MDL Junior Member

    Joined:
    Aug 5, 2009
    Messages:
    58
    Likes Received:
    13
    Trophy Points:
    0
    #18 solo_voyager, Feb 12, 2021
    Last edited: Feb 12, 2021
    (OP)
    I have found that many if not almost all the entries in my hosts file are variations of Pirate Bay URLs.
    There are hundreds of them listed on there.
    I've never heard of most of them before.
    I am blocked from making any additions or deletions by its being accessed by another process.

    As I remember, there was the hosts file and maybe a couples of other files in the etc folder.
    Now there are a number of new files in there: hosts.backup, hosts.check, Imhosts, Imhosts.sam, as well as what I think were the original files: hosts, networks, protocol, and services.

    it's beginning to look to me as if someone is trying to control where I go online,
    Nobody has that right, except me..

    EDIT:
    I had to add " .txt " to the file to get it to show in Explorer.
     

    Attached Files:

  19. solo_voyager

    solo_voyager MDL Junior Member

    Joined:
    Aug 5, 2009
    Messages:
    58
    Likes Received:
    13
    Trophy Points:
    0
    I had d/l'd sysinternals last night.
    I got a huge, very long list where it was very difficult just to find one entry that did seem to point to the hosts file.,
    That was Explorer there may have been more but it looked to be difficult and time consuming to nail anything down.
    So, I put it down.
     
  20. drew84

    drew84 MDL Addicted

    Joined:
    Mar 13, 2014
    Messages:
    956
    Likes Received:
    1,491
    Trophy Points:
    30
    #20 drew84, Feb 12, 2021
    Last edited: Feb 12, 2021