In this tutorial i will show you how to block ads, banners, make web sites load faster and save on bandwidth using the built in Windows/Linux OS’s HOSTS file.
What is a HOSTS file:
A HOSTS file is a file that is located in a Windows or Linux/Unix file system, it will usually be located under:
a sample of a HOSTS file will look like this:
this means that every request from your PC to adcomplete.com will be redirected to 0.0.0.0, which is a non-routable meta-address. so, for example, lets say that you are browsing to Yahoo.com, in Yahoo.com site there are banners coming from adcomplete.com, these banners will not be displayed in your browser because the request will be redirected to your a non-routable meta-address which returns nothing.
How to do it:
- Go to this site http://winhelp2002.mvps.org/hosts.htm
- Click the Hosts.zip link and download the file to your Desktop
- Extract the zip file to you Desktop
- Go to the HOSTS file location in your OS, /etc for Linux or \drivers\etc for windows and backup your original HOSTS file, you can rename it to HOSTS.orig
- You can double click the mvps.bat file for an automated process or you can manually copy the HOSTS file inside the zip to the desired location according to your OS, Windows or Linux
- Open a CMD window and type ipconfig /flushdns. this will flush the DNS cache, the DNS cache stores IP addresses and their respective web name address. for the OS to refresh the changes that you’ve made to the HOSTS file you need to run this command
- Optional: you can open your new HOSTS file using any notepad application, like Notepad++ and add any web address you want and 0.0.0.0 (0.0.0.0 <AnyWebAddress>), this will make this address invalid untill you delete this entry from the HOSTS file