We all hate ads, don’t we?
Luckily nowadays there are many browser extensions like AdBlock and his brother AdBlock Plus that lets you block ads on the web using blocklists like EasyList. They do a great job and get better and precise in every new list and extensions updates, for example now both extensions can block ads in a page even before they get downloaded to help you save bandwidth and time since the page will load faster. But those are extensions of your web browser so they will need some RAM memory to work and also they could make your browser run slower, especially if you do some intense browsing and you have multiple tabs loaded.
Is there a way to block all possible ads, like AdBlock and AdBlock Plus do without extensions? The answer is: yes [of course] and you don’t need any additional software we just need the already present host file.
For the one who don’t know a host file is a file present in all OSs in which there is a list of websites who the user won’t be able to access. This is a [empty] host file:
So, for example if I don’t want the user able to access the New York Times website I just need to add it like this in the host file like this:
and the website will be blocked. This principle can be used to block ads websites and already know malicious one [full of malware, viruses, etc.] but to be sure to block all of those sites you will need to add every single one of them to the host file and, trust me, there are a lot of them.
Luckly MSMVPS already did the job for us creating a host file with all those websites and they also update it once a month with newly discovered bad-websites and all the ads stuff. Here you can download the latest version:
There are 3 different ways to install it, based on your operative system:
- Right click and select “Run as Administrator” on the mvps.bat file
It will do the job for you renaming the old host file to host.mvps for backup and replacing it with the new one.
- Mac OS X:
- Copy the HOST file and replace the one in private/etc/
[If you need help to reach this folder press Command+Shift+G and write “private/etc/”, then press Ok]
- Open the Terminal and paste this text to flush the DNS Cache:
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- In the Terminal run:
- Fill the file with:
#!/bin/bash cd /tmp wget http://winhelp2002.mvps.org/hosts.txt rm /etc/hosts mv hosts.txt /etc/hosts cat ~/.etchosts >> /etc/hosts
- Make the script is executable:
chmod +x update_hosts.sh
- Close the Terminal and re-open it and paste this:
- Enter this:
59 23 * * * /root/update_hosts.sh
There you have it, now your OS will block those noisy ads for you and you won’t need any AdBlock extensions, also this will also add an extra layer of security to your system.