How to Block Websites

Page 1 of 3 123 LastLast

  1. Posts : 151
    Windows 10
       #1

    How to Block Websites


    I have googled a bit and found software that can be used to block websites on a computer. I also found another way by using Windows which I would prefer. My problem is I must be doing something wrong. Here is the site that has the steps.
    How to block websites | PCWorld

    Here is what happens when I perform step 6. I am the administrator by the way.

    How to Block Websites-image.png

    Any ideas on how to make this work?
      My Computer


  2. Posts : 8,108
    windows 10
       #2

    Your saving it as a .txt file it has no extention
    from a admin cmd prompt type

    attrib -r %WINDIR%\system32\drivers\etc\hosts

    when its saved run

    attrib +r %WINDIR%\system32\drivers\etc\hosts

    the host file is read only
      My Computer


  3. Posts : 151
    Windows 10
    Thread Starter
       #3

    Thanks Samuria. I'm sorry but I'm not sure what you mean. The only place I can save it to is documents. Opening it from documents does not show what I added. I ran attrib +r %WINDIR%\system32\drivers\etc\hosts but not sure that it worked.

    Could you elaborate a little more? Sorry for my confusion.
      My Computer


  4. Posts : 8,108
    windows 10
       #4

    The host file is read onlythats why you cant save it so you run the first cmd which removes it than copy your file making sure it has no extention then run second cmd to set it back read only you can open the file in notepad to see if its correct
      My Computer


  5. Posts : 265
    Windows 10 Enterprise
       #5

    OK, go ahead and save the file in documents after you have made your changes. Then rename the file from hosts.txt to hosts

    Now copy the hosts file from the document folders to the %windir%\system32\drivers\etc\ Then it will work as advertised.
      My Computer


  6. Posts : 151
    Windows 10
    Thread Starter
       #6

    I have the document in the etc folder

    How to Block Websites-image.png

    It is still a text file. And it does not block the website. I cannot do what you suggested by saving to docs and changing name. But at least its in the folder. Now how to make it work.
      My Computer


  7. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #7

    You cannot save to the Windows\System32\drivers\etc folder, it is too well protected. You can however copy or move a file into that folder, so create your HOSTS file somewhere else then put it there.

    BTW, it is better to use 0.0.0.0 instead of 127.0.0.1 in the HOSTS file. Apparently there's a latency issue with Microsoft's TCP loopback interface where 127.0.0.1 causes a slowdown, while 0.0.0.0 does not.
      My Computers


  8. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #8

    copiman said:
    It is still a text file. And it does not block the website.
    That's because it still has the .txt extension, but you have known extensions hidden so you can't see (or change) its extension. In File Explorer on the View ribbon tick the box to Show file extensions, then you'll be able to rename it to just HOSTS. You'll first need to rename the original hosts file that's already there before you can rename yours.
      My Computers


  9. Posts : 8,108
    windows 10
       #9

    To make it work you need to reboot or from a cmd prompt type

    IPCONFIG -flushdns
      My Computer


  10. Posts : 31,660
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #10

    Samuria said:
    To make it work you need to reboot or from a cmd prompt type

    IPCONFIG -flushdns
    Actually, I've found that since Windows 10 you no longer need to do that. You certainly had to reboot Windows 7 for changes to take effect, but just renaming it to HOSTS should be sufficient in 10. All I need to do when I want to stop my HOSTS file from blocking sites is to rename it temporarily.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:22.
Find Us




Windows 10 Forums