How to Block Websites Using Notepad

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Image Credit: Jupiterimages/Pixland/Getty Images

If you want to block specific websites from your computer, you can do so by modifying the Hosts file on the computer with a text editor, such as Notepad. The Hosts file is the file on the computer that tells it what websites to map to what IP addresses. By placing a certain line of code in this file, you can block any website you want, and your computer will not be able to get to it.

Advertisement

Step 1

Open Notepad on your computer by clicking "Start," "All Programs," "Accessories" and then "Notepad." If you are running Vista/7, you will need to right-click the program name and select "Run as Administrator."

Video of the Day

Step 2

Click "File," "Open" and then browse to the following file: "C:\windows\system32\drivers\etc\hosts." The Hosts file has no file extension. Click the "Open" button.

Advertisement

Step 3

Put two new lines into the Hosts file for each website that you wish to block. The two lines are "127.0.0.1 www.examplesite.com\" and "127.0.0.1 examplesite.com," where "examplesite.com" is the example website you wish to block.

Advertisement

Step 4

Save the file and exit Notepad. The website is now blocked.

Video of the Day

Advertisement

Advertisement

references