Ad block

This post speaks about blocking ad sites without installing any kind of software (net filter, local proxy, browser add-ons …). Browsing without ads should be faster because browser has less content to render. It is can be used on Windows, Mac OS X, BeOS, Netware and so on. The trick is to define ad sites in the hosts file with localhost IP address. This way, browser will not be able to resolve real IP address and ad will not be loaded.

During the name resolution process, operating system (Linux, Windows …) will first look in the hosts file. If hosts look-up failed, then OS will ask DNS. So, writing unwanted server names to the hosts file, will actually redirect browser requests for an ad to the non-existing address. Instead of ad content, browser will get “Page not found – connection failure”.

Till now everything looks clear, but does it mean to create ad list manually? Fortunately, ad list already exists and you only have to append this list to your hosts file. Locations of Linux / Windows hosts file are:

  • /etc/hosts (Linux)
  • %SystemRoot%\system32\drivers\etc\hosts (Windows)

If you want to read more about hosts file, please visit page. There you will find all details and hosts file locations for other operating systems.

The described method is simple and efficient. It will work no matter which browser you prefer or which user is currently logged. You will not only filter unwanted ad content but you will also save bandwidth and speed up browsing. And finally, you can watch small video on YouTube where author explains this trick with hosts file.

Leave a Comment