Home > FAQ & Tip > How to blocking unwanted domains or ads

How to blocking unwanted domains or ads

September 4th, 2007 Leave a comment Go to comments

Today, the number of internet domains is exponentially increased and keep counting. There are wanted and unwanted websites/domains to visit. In most case users have no control of how/what page contents are being displayed. Some users can affort to purchase a software which run at the system level to block unwanted contents while some cannot affort or they don’t like to purchase the third party software because of the cost is not reasonable enough.

Well, you don’t have to live with it if you don’t want to. There are some work-around to prevent a certain page content from being displayed while you are browsing. Let’s take advantage of the hosts file and make your browsing experience more pleasure.

Read more about host file

This file contains a list of mappings of IP addresses to host names. You can use this file to block an unwanted or ads site/domains by following a few simple steps below.

Locating hosts file

This will depends on which OS you are using

  • Windows 95/98/Me : %windir%
  • Windows NT/2000/XP : %SystemRoot%system32driversetc
  • Linux : /etc
  • Max OS X : either /private/etc or /etc

Backup

Now you should see “hosts” file under one of those directories.
Before you go ahead, you might want to make a backup of this file (eg. hosts.bak) incase you want to restore it latter.

Make changes

By default, you should see the following line
127.0.0.1 localhost
Now add/append the host names to the end of this file.
Note that ‘#’ character is for masking comment, any line begine with ‘#’ will not be read from this file. Lines below are example only, you need to define your own url or domain name.

# Blocking the ads
0.0.0.0 ads.msn.com
0.0.0.0 doubleclick.net
0.0.0.0 unwantedadsprovider.com
# Blocking unwated site
0.0.0.0 thesiteyoudontlike.com
0.0.0.0 somepornographysite.com
Now, save the file (Windows you might need to restart your computer)

Ready to browse

Open your web browser then naviage to those pages you are trying to block the ads.
You will notice the your targeted ads doesn’t display on the page you are viewing anymore.

Categories: FAQ & Tip
  1. No comments yet.
  1. No trackbacks yet.