How to Block a Website Using Command Prompt
One way of blocking your computer from accessing a specific website is with the Microsoft Windows Command Prompt utility. This feature comes in handy when you want to make sure your children are not going to their favorite websites when they should be studying.
Shut down all applications and programs on your computer.
Press the "Windows-R" keys at the same time.
Type "cmd" in the field and select the "OK" button.
Type "notepad C:/Windows/System32/drivers/etc/hosts" in the command window.
Find the line that contains "127.0.0.1 local host."
Type "127.0.0.1 URL" on the next line, with "URL" being the site you want to block. For example, if you want to block CNN, type "127.0.0.1 cnn.com."
Save the file. Exit all windows.
Tips & Warnings
- Add each URL that you want to block on a new line in the hosts text file you open with the Command Prompt.
- Most Web browsers also let you block specific website addresses under the "Privacy" or "Security" settings tabs.