[To backup the default hosts file]
Run Command Prompt as Administrator (Click Start Menu, go to All Apps, go to Windows System, right click on Command Prompt, select Run as Administrator)
Type "cd\"
Type "cd Windows\System32\drivers\etc"
Type "dir"
Type "Copy hosts c:\temp"
[NOTE: Do not type the quotation marks]
[NOTE: This will automatically create the folder in your C:\ Drive, even if it doesn't exist]
[To view and/or edit hosts files]
Run Notepad as Administrator (Click Start Menu, go to All Apps, go to Windows Accessories, right click on Notepad, select Run as Administrator)
Select File>Open
Navigate to hosts file (default is found in C:\Windows\System32\drivers\etc)
Select All Files (hosts files aren't text files)
Open the correct hosts file
Make any necessary changes
Save
[NOTE: Do not Save As, as this will save the hosts file as a text document instead of a file]
[NOTE: To add websites to your hosts file, simply type your default IP Address followed by the website URL]
[NOTE: The default IP Address is 127.0.0.1]
[NOTE: Make sure to backup your default hosts file before making any changes]
[NOTE: When you edit a hosts file, copy the unedited hosts file under a different name and then make changes]
[To replace the default hosts file with the new hosts file]
Navigate to the new hosts file
Copy new hosts file to desktop
Navigate to C:\Windows\System32\drivers\etc
Rename hosts to hostsOLD (or something similar, so you know it's the default hosts file)
Copy the new hosts file from desktop to the hosts folder
Restart browsers
[NOTE: You could use a .bat to install a community hosts file, but it's both easier and more reliable to do it yourself]
[NOTE: You do not have to reboot your computer, as any changes to your hosts file is immediate]
[NOTE: Your system only recognises the hosts file with the name "hosts" or "HOSTS" without the quotation marks, so make sure the hosts file that you want to use has the correct name, and that all other hosts file have different names]
[To force read your hosts file]
Run Command Prompt as Administrator (Click Start Menu, go to All Apps, go to Windows System, right click on Command Prompt, select Run as Administrator)
Type "ipconfig /flushdns:
[NOTE: Do not type the quotation marks]
[To shutdown DNS Client (mandatory with hosts files larger than 135 kilobytes)]
Win+R to open Run
Type services.msc
Scroll down to DNS Client, right click, and select Properties
Select Stop
Click the drop-down arrow for Startup type
Select Manual
Click Apply/OK and restart
[NOTE: You will have to shutdown the DNS Client with a community hosts file]
[NOTE: Make sure to turn DNS Client back on if you revert to default hosts by following the above steps and changing the startup type to automatic]
That should be everything.
Here is the link to a reliable, routinely updated community hosts file that blocks all of the major ad-servers and known malware sites. You can update it yourself as you please.
http://winhelp2002.mvps.org/hosts.zip
Please exercise caution, as the hosts file controls everything that has to do with the internet, and I mean everything, on your computer. If you're not careful, you could severely cripple your entire system. If, however, you follow all the instructions to the letter, you should be fine.