Want to block all users of a Windows PC from opening certain websites, regardless of the browser they use or the time of day? You need only make a few simple additions to the Windows hosts file. This method is straightforward and free, and it doesn’t require you to download or install any additional software. It’s an effective method for restricting users of all ages from seeing the content you don’t want them to access.
How to block websites on your PC
1. Open Windows Explorer and navigate to C:\Windows\System32\drivers\etc. (If Windows is not installed on C:, substitute the appropriate drive letter.)
2. Double-click hosts, and select Notepad when Windows prompts you to choose a program. If you don’t get the prompt, or if the hosts file opens in another program, open Notepad (Start, All Programs, Accessories, Notepad), and then navigate to hosts by clicking File, Open within Notepad.
3. Place the cursor at the end of the last line, which will say something such as “127.0.0.1 localhost” or “::1 localhost”. Press Enter to create a new line.
4. Type 127.0.0.1, tap the spacebar once, and then type the address of a website you want to block. For example, to block all traffic from YouTube, type 127.0.0.1 www.youtube.com on this line.
5. Continue to add the websites you wish to block, each prefaced with 127.0.0.1 and a space.
6. Click File, Save to commit to your changes. Dismiss any warnings from antimalware software, which may be triggered by your editing of the hosts file.
7. Close any open browser windows, and then reopen a browser to test your edits. The blocked sites should not display in any browser.
How to selectively block websites based on user or time of day
If blocking a site from all users at all times is overkill for your situation and you want more control, try using your router’s web interface to block a website selectively.
1. Open a browser and enter your router’s IP address into the address bar. Refer to your router’s documentation for the IP address, or, if you don’t immediately know it, try a common address such as http://192.168.1.1, http://192.168.0.1, or http://192.168.2.1.
2. Enter your username and password. If you haven’t changed the username and password, and you don’t know the defaults, visit Port Forward’s Default Router Passwords page to find them.
3. Browse to the section where you can block websites, computers, and access during certain times of day. Router interfaces vary, but look for a section with a name such as “Access Restrictions.”
4. Enter the details of the content and the users you’d like to restrict, and save your changes. Your router’s paper or electronic documentation should provide full instructions.
Remember to exercise caution when editing your hosts text file, and always make sure to back up files before you edit them. Good luck!