How to block most ads & some malware sites.
- Introduction
In this guide I will teach you how to block most of the sites that provide the ads and a few detected servers around the world that distribute malware using the hosts found at mvps.org in Windows ; I will teach you how to setup it and check if it's working once you are done. This might be a simple guide, but a very useful one. Note: I will post the location of the hosts file for Linux and Mac, you can follow the guide using the programs of you operating system.
- Understanding how it works
- Host File:
"The hosts file is a computer file used in an operating system to map hostnames to IP addresses. The hosts file is a plain-text file and is traditionally named hosts." From Wikipedia.org
"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" From mvps.org
- Location of the hosts file:
- Linux: /etc/hosts
- Windows: %SystemRoot%\system32\drivers\etc\
- Mac OS X: /private/etc/hosts
- Editing hosts file: You must use Administrator/root privileges, and just use a text editor.
- Host File:
- Getting the hosts
We'll be using the plain text file provided by mvps.org at http://www.mvps.org/winhelp2002/hosts.txt
You must copy from
Code:#start of lines added by WinHelp2002 # [Misc A - Z]
To the end of the file
You can now save the file!
- Checking it works!
We must now ping any address that it's on the file. Type this on cmd/terminal/ssh
Code:ping images.adster.com
It should show something like this:
Enjoy 0.00001% ads browsing with more malware protection!
Thanks for reading!


























