How to Block Certain Websites From My Command Line

by Fatima Farakh
See snippets from your favorite news sources all in one place on your My Yahoo page.

See snippets from your favorite news sources all in one place on your My Yahoo page.

The command line in Microsoft Windows allows you to quickly run a particular command and receive an immediate response from the computer in the window prompt. Specific websites can be blocked from the command line by running a command to open the Windows Hosts file, a text file in Notepad that controls access to the Internet. Adding the website you wish to block to the Hosts file and saving it will prevent any further access to that specific website domain name.

1

Click the "Start" button and select "Run."

2

Type "cmd" without the quotes in the "Open" field and press the "Enter" key or click "OK."

3

Type "notepad c:\WINDOWS\system32\drivers\etc\hosts" without the quotes in the command line window.

4

Scroll to the end of the text file in Notepad.

5

Type "127.0.0.1" without the quotes and then the name of the website you want to block. For example, type "127.0.0.1 website.com" without the quotes to block website.com. Repeat this step for each website you want to block.

6

Click "File" in the Notepad menu bar and then "Save" to save to file when you are finished adding each website.

7

Close Notepad.

8

Close the command line.

About the Author

Fatima Farakh has been writing professionally since 2001. Her articles have appeared in "The Gazette" newspaper in Maryland and in other publications. Her areas of specialization are health, technology and home improvement. She is currently a copywriter for businesses, including private and public schools and online corporations. She holds an Associate of Arts in journalism and history from Montgomery College.

Photo Credits

  • photo_camera Jupiterimages/Pixland/Getty Images