hosts file tampered with

Discussion in 'Windows 7 Help and Support' started by zaven, Jul 1, 2010.

  1. zaven

    zaven New Member

    Joined:
    Feb 12, 2010
    Messages:
    12
    Likes Received:
    0
    Hello,

    I've tampered with my hosts file when installing some software, which didn't end up working for me in the end. Are there any big issues with keeping my file in this state? It seems to be ok but I would like to return my hosts file to its original state, and all the tutorials online seem to bring me roadblocks.

    The only thing I'm noticing different with my computer is that the search function isn't working, but that could be unrelated. Anyone have an idea what that might be?

    So I'm just looking to get my hosts file back to normal, and hopefully get my search functioning again. Thanks
     
  2. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    Have you tried right clicking on the file and select "Restore Previous"?
     
  3. TorrentG

    TorrentG Banned

    Joined:
    May 31, 2010
    Messages:
    7,814
    Likes Received:
    372
    Here is your hosts file. Seriously. Just copy and paste this into and then save this with notepad overwriting the one you have now at C:\Windows\System32\drivers\etc\hosts

    Code:
    127.0.0.1  localhost
    You can add any entries to it you want in the future as long as you keep this as the top line.
     
  4. zaven

    zaven New Member

    Joined:
    Feb 12, 2010
    Messages:
    12
    Likes Received:
    0
    That sounds easy enough, however do i need to disassociate the hosts file so i doesn't show up as a .txt file? or will the hosts file work fine as a .txt?
     
  5. TorrentG

    TorrentG Banned

    Joined:
    May 31, 2010
    Messages:
    7,814
    Likes Received:
    372
    Right. You have to make sure it saves as hosts and not hosts.txt.

    It probably will save as hosts.txt so you can navigate there in Explorer and rename it by removing the .txt.

    You might have to set Explorer to show extensions. That's simple enough to do as well. Click Computer. Organize | Folder and Search Options | View tab

    Take away the check boxes for
    "Hide extensions for known file types" and also
    "Hide protected operating system files" and
    click the radio button for "Show hidden files, folder and drives"

    Click ok after. Then go to rename. Delete the original hosts first if it is present.
     
  6. Highwayman

    Highwayman Extraordinary Member

    Joined:
    Jun 3, 2009
    Messages:
    3,977
    Likes Received:
    112
    Have to agree TorrentG's method is simplest and easiest method to clean hosts file, also if you need a bit more web protection use Spybot S&D to add hostfile blocks for thousands of known malware IPs.
     
  7. zaven

    zaven New Member

    Joined:
    Feb 12, 2010
    Messages:
    12
    Likes Received:
    0
    Cheers!

    I've successfully followed your instructions and it seems to be fine. Originally I went to the windows site and used their auto fix tool to try and reset my hosts file. After using the tool i think it added a file "lmhosts". Could i delete this file as well? because when opened in notepad it reads "This is a sample hosts file....".

    Thanks for your help torrentG and highwayman for the confirmation, I should have resorted to this thread ages ago.
     
  8. zvit

    zvit Honorable Member

    Joined:
    Nov 3, 2009
    Messages:
    2,455
    Likes Received:
    84
    If it says lmhosts.sam, it's just a sample file and you can ignore it, it doesn't do anything. Active files have no extension. Their names are just HOSTS and LMHOSTS, usually in lower case. Anything that has a '#' at the begining of the line is not executable code, but just a note.

    If you are just a home user and are not connected to a local network, you don't need to use it. If it says lmhosts, just add a ".sam" to it so you will be using the hosts instead.
     
    #8 zvit, Jul 8, 2010
    Last edited: Jul 8, 2010

Share This Page

Loading...