Just follow the steps below:
- Open Windows Explorer and navigate to C:\Windows\System32\drivers\etc. If Windows is not installed on C:, substitute the appropriate drive letter.
- 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.
- 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.
- Continue to add the websites you wish to block, each prefaced with 127.0.0.1 and a space.
- 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.
- Close any open browser windows, and then reopen a browser to test your edits. The blocked sites should not display in any browser.