hosts file tampered with

zaven

New Member
#1
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
 


Saltgrass

Excellent Member
Microsoft Community Contributor
#2
Have you tried right clicking on the file and select "Restore Previous"?
 


#3
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.
 


zaven

New Member
#4
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
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.
 


Highwayman

Extraordinary Member
#6
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.
 


zaven

New Member
#7
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.
 


zvit

Honorable Member
#8
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.
 


Last edited:
This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.