How to Block Certain Websites From My Command Line

by Fatima Farakh

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.


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


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


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


Scroll to the end of the text file in Notepad.


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


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


Close Notepad.


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.

More Articles

Photo Credits