How to Block Certain Sites on Windows Computer

Have you ever thought about blocking a site so that it can’t be accessed on your computer/laptop? For example, such as websites that are disturbing or disturbing, or maybe blocking video streaming sites so that data quotas are kept safe. Of course it depends on the user’s own needs.

Blocking websites on a Windows computer is very easy. The fact you no need to install any more programs and can do it easily. All it takes is to redirect or edit a single file.

The file is Host. And not only on Windows, even on Linux there is also the Host file which is useful as a domain mapping with the appropriate IP. But if you set the wrong IP on a domain, surely that domain will not be accessible. And this method will be used.

Tutorial on Blocking Certain Websites on Windows

From the old version of Windows until now (Windows 10), this hosts file located in the same directory. And to edit the file, you can use Notepad, but make sure you run Notepad as an administrator so you can save the file later. Alternatively, you can also use the Notepad++ program.

And here are easy steps to block a website on Windows:

  1. Open Windows Explorer.

  2. Please go to the directory C:\Windows\System32\drivers\etc.

  3. Right click on the file host and select Edit with notepad++.

    Right Click on Hosts File

  4. After that add the following line to block a site:

    Please change the with the domain of the website you want to block.

    Blocking Certain Sites on Windows Computer

  5. After that save the file.

Instantly the website that you added like the format above will be inaccessible. This is because the domain has been set to go to the wrong IP address, so the result is that the internet connection will not respond when accessing it.

If you haven’t installed the Notepad++ program, you can also edit via Notepad. First, run the Notepad program as an administrator. Then click option File > Open and go to the hosts file directory earlier. Now so that all files appear, please set the Format option as All Files. Surely the hosts file will appear immediately and can be edited.


If you feel you don’t need to block a site, you can return it to the beginning in a very easy way. That is enough delete just the format that was added to the previous Hosts file.

After it is deleted, surely the site will be immediately accessible again. But if it’s still not accessible, please clear cache on the browser you are using and then try to access it again.

Also read: How to Open a Web Blocked by Positive Internet


No need to install a special program to block a website, because just adding a little text to the Hosts file is enough to do that. And even this method can also be applied to block online game access you know.

Overall all you need is the address/domain of the site you want to block. After knowing that, just add it to the Hosts file according to the format described above.

If you have any questions regarding the method shared above, don’t hesitate to comment to get a solution.

Hopefully useful and good luck