Advanced Users Only!
Most people can do this without a problem, but be careful which lists you use with Hostsman! I use MVPS hosts, hpHosts (Adtracking), and Peter Lowe's Adsevers lists. The full hpHosts lists adds MANY false positives, namely torrent sites. So only use the adtracking one.
Everyone hates ads when surfing the internet, which is why ad-blockers exist. However, they don't actually STOP the connections. They just remove the visible images. Also, there are many sites that exist to hijack data or install malware on your PC. Not very fun.
However, with the Windows Hosts file, you can block the sites themselves from ever connecting to your computer!
Technical information below:
The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory (cache) at startup, then Windows checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS. This prevents access to the listed sites by redirecting any connection attempts back to the local (your) machine. Another feature of the HOSTS file is its ability to block other applications from connecting to the Internet, providing the entry exists.
You can use a HOSTS file to block ads, banners, 3rd party Cookies, 3rd party page counters, web bugs, and even most hijackers. This is accomplished by blocking the connection(s) that supplies these little gems.
In many cases using a well designed HOSTS file can speed the loading of web pages by not having to wait for these ads, annoying banners, hit counters, etc. to load. This also helps to protect your Privacy and Security by blocking sites that may track your viewing habits, also known as "click-thru tracking" or Data Miners. Simply using a HOSTS file is not a cure-all against all the dangers on the Internet, but it does provide another very effective "Layer of Protection".
Today I will give you two tools to make using the HOSTS file easier and pain-free.
First is
http://www.mvps.org/winhelp2002/hosts.htm which explains more about the HOSTS file and comes with a zip file to download.
http://www.mvps.org/winhelp2002/hosts.zip
Run the tool included in this archive as an administrator, and it will auto-patch the hosts file.
However, we can do better then that.
Download Hostsman from
http://www.abelhadigital.com/hostsman and install it. From manage update sources, use the ones I mentioned, MVPS hosts, hpHosts (Adtracking), and Peter Lowe's Adsevers lists. The full hpHosts lists adds MANY false positives, namely torrent sites. So only use the adtracking one. DO NOT SELECT OPTIMIZE HOSTS. This turns the file into a rubbish mish-mash which makes it impossible to select single entries to delete, add, or search.
From here on, you can simply click the button to update the hosts file. If you notice one of your sites is no longer working, search for it with Hostsman's searchable editor, which makes tweaking the HOSTS file easy.
I currently have 23,540 sites blocked with mine.