Helping you here

Share This Post

Block or Redirect Unwanted Websites Using HOSTS File




Block Websites Using Hosts File

The hosts document is one of the fascinating and valuable component of both Windows and Linux working systems that gives numerous convenient choices in tending to network hubs. For example, you can utilize the hosts document to square irritating promotions, pop-ups, pennants, porn locales, or even divert one site to another. 

In this post I will demonstrate to you best practices to play around with the hosts document to accomplish a portion of the previously mentioned employments. 

What is a hosts File? 

The hosts record is much the same as whatever other computer document that is utilized by the working system to outline and domain names on to their relating IP addresses. 

As it were, the point at which you write "google.com" on your program's address bar, your computer will search for the hosts document to check whether it contains the comparing IP address for the domain name you wrote (google.com). On the off chance that if no passage is available in the hosts document, the demand is then passed on to the DNS (Domain Name System) server to get the IP address. 

hosts File versus DNS 

With regards to settling the hostnames, the hosts record is given the principal need over the Domain Name System. Much of the time, the hosts document remains unconfigured on the working system and thus the DNS is utilized by the computer to determine the domain names to their relating IP addresses. 

In any case, if the hosts document is found to contain a legitimate section for a given hostname or domain name, then this is grabbed and utilized by the working system.

Where is the hosts File Located?

Windows: In case of the Windows operating system, the hosts file is located at:
%systemroot%\system32\drivers\etc\hosts
NOTE: In most cases this should be: C:\Windows\System32\drivers\etc\hosts
Unix/Linux: In case of Linux it is located at:
/etc/hosts

How to Block a Website?

To Block a particular site, you should simply include another section for that site in the hosts document. I would like to reinforcement the first record and make another one as opposed to adjusting it. Along these lines, if something turns out badly, you can simply erase it and reestablish the first one! All things considered, here is a well ordered system on the most proficient method to make another hosts document on Windows:
  1. Go to “My Computer” and you should see the “Menu bar” on top. In case ofVista and Win 7, just click “Alt” to unhide the “Menu bar”.
  2. Now in the menu bar, click on “Tools -> Folder Options”. In the “View” tabuncheck the option that says: “Hide extensions for known file types” and click on “OK”.
Windows Folder Options
  1. Open a new text pad (New Text Document.txt) and rename it to: hosts. You will get a pop-up message with a warning. Just click on “Yes”.
    Please note that the renamed file hosts should not have any extensionsuch as
    hosts.txt.
  2. Open the hosts file using the notepad. Now let us assume that you want to block the sites Facebook and Youtube on your computer. For this all you have to do is add the following lines to your hosts file:
    127.0.0.1       facebook.com
    127.0.0.1       www.facebook.com
    127.0.0.1       youtube.com
    127.0.0.1       www.youtube.com
    Each entry should be placed on an individual line. The IP address and the hostname should be separated by a space or a tab. In this way, you can block any given website by just pointing it to the IP address 127.0.0.1.
  3. Navigate to %systemroot%\system32\drivers\etc. Here you should see the original hosts file, rename it to hosts_bak. Just copy and paste the newhosts file that you have created. That’s it. You’ve now successfully blocked those websites from loading on your computer.
    If you are using Vista/Win 7 you may have to take ownership of the originalhosts file before renaming it.

How to Redirect a Website?

Suppose you want to redirect Friendster.com to Google.com, all you have to do is just add the following lines to your hosts file:
74.125.236.72       friendster.com
74.125.236.72       www.friendster.com
Here 74.125.236.72 is the IP address of Google.com. To find out the IP address of any given website, just go to command prompt and ping it. For example: ping google.com. You should get a ping response that displays the IP address as shown below:
Ping Test
From now on, whenever you type “friendster.com” on your browser, you will be redirected to “google.com”.

How does a hosts File work?

Whenever you block a website using the hosts file, you point it to the IP address127.0.0.1 which in fact is the IP address of your own computer. In other words, the IP 127.0.0.1 points to your own computer and doesn’t exist outside.
So, whenever you type the URL of a website for which an entry is present in thehosts file, your computer will load the IP as 127.0.0.1 instead of the actual one and tries to establish a connection with this IP address (127.0.0.1) but fails. As a result the website doesn’t load at all.
The redirection of the website works by pointing the domain name of one website to the IP address of another website (as configured by the hosts file) instead of its original IP address. So, whenever you type friendster.com, it is pointed to Google.com’s IP address and thus, the Google page loads up instead of the actual page from friendster.com.

How to Block the Annoying Ads?

I have found a great solution to keep all the annoying ads, banners, pop-ups and other parasites at bay by using a pre-configured hosts called MVPS hosts file. This hosts file contains a long list of entries to block all those annoying ads and pop-ups that usually load while you are surfing the Internet. You can also receive regular updates on this to stay up-to-date. You can download MVPS hosts file from the link below:
If you are playing around with the hosts file and something goes wrong, just delete the hosts file itself and rename the original file from hosts_bak to hosts. This should bring back everything to normal. I hope this post on hosts file will help you block unwanted websites on your computer. Waiting for your comments. :)


Responses

0 Respones to "Block or Redirect Unwanted Websites Using HOSTS File"

Post a Comment

Thanks For Visiting!
Please Leave Your Comment!

Related Posts Plugin for WordPress, Blogger...
 

Pages

For watching Movies

Contact Form

Name

Email *

Message *

Popular Posts

Return to top of page Copyright © 2014 / 2015 | Pro Theme Design By Mr Kilari