Block a website on Windows 10: with hosts file, Notepad

Block a website on Windows 10: with hosts file, Notepad

Here's a short guide on how to block users of a PC from accessing certain websites, regardless of the browser.

How to block certain websites on your PC?

Do you want to block some websites on your home or work PC so all its users can't access certain content? There is a quick method that doesn't require any additional software. You need to only make a few additions to the Windows hosts file.

  • Open Windows Explorer and go to C:WindowsSystem32driversetc. 
  • Double-click on hosts and choose Notepad from a list of programs.
  • Place the cursor at the end of the line with this or similar text "127.0.0.1 localhost" or "::1 localhost" and press Enter to create a new one.
  • Type 127.0.0.1, tap Space, and type the website address you'd like to block access to. (e.g., 127.0.0.1 www.facebook.com)
  • Add other websites you want to block prefaced with 127.0.0.1 and a space.
Notepad – block a website Windows 10
© Notepad
  • Click File > Save.

  • Close your opened browser windows and try to access the restricted websites to see if that worked. The blocked websites won't be displayed in any browser.

How to block websites for kids on Windows 10 via Microsoft's website?

  • Go to family.microsoft.com and sign in with your Microsoft account. 
  • Find your kid's account on the Your family page and click on More options > Content restrictions
  • In the Web browsing section, switch on the Block inappropriate websites option. This will automatically restrict the children's access to some dangerous websites.
  • To add a website to the restricted list, click Add a website you want to block and type the URL. 
  • Another option is to make a list of allowed websites. To do so, click Only allow these websites and type the URLs of websites you want to allow.
  • Finally, close the page, and the changes will apply.
do you have more questions about windows 10? check out our forum!

Windows 10