• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to block / redirect websites using the Windows host file
#1
How to block / redirect websites using the Windows host file

Really quick one liner of what a host file is.
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.


Steps

1) The file we're looking for is located in C:\Windows\System32\drivers\etc

[Image: how-to-block-websites-using-windows-host-file-01.png]


2) Open the hosts file in Notepad.

[Image: how-to-block-websites-using-windows-host-file-02.png]


3) Your hosts file will look similar to below, (except I have a few other entries in mine that I've blurred out...) simply add the desired website at the bottom, eg.
127.0.0.1 websitehere.com
That will redirect websitehere.com to 127.0.0.1 (localhost)

[Image: how-to-block-websites-using-windows-host-file-03.png]


4) File > Save As > hosts
Make sure All Files is selected (*.*)

[Image: how-to-block-websites-using-windows-host-file-04.png]


5) Try to get to the website...

[Image: how-to-block-websites-using-windows-host-file-05.png]


6) And if we try a ping...

[Image: how-to-block-websites-using-windows-host-file-06.png]


Simple. Remember this only works on the machine that you do it on.
  Reply
#2
This can be used for blocking ads as a System-Wide thing. Wink
[Image: nomnomnom.jpg]
;7$=v?%v%#5>v7v8994
The decrypt code is V, I could not make it any simpler!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HOW TO BLOCK UNWANTED EMAILS Clones 4 11,993 09-10-2011, 05:20 PM
Last Post: baracuDa™

Forum Jump: