Advertisement
How-ToWindows

How to Block a Website in Windows 10 Using Hosts File

Advertisement

Why would you like to know how to block websites? Would you like to keep your children safe on the Internet, perhaps? Maybe you want to block websites that are annoying so that you don’t procrastinate? In this guide, you are going to learn how to block a website on Windows 10 using a hosts file.

In the meantime, many people want to know how to block websites on Microsoft Edge, Chrome, or even on Firefox. However, if you block certain websites on Microsoft Edge but unfortunately it can be opened on Chrome or Firefox. So, the best way to block a specific website on Windows 10 is using the host file, because the blocked website can’t be viewed or opened by any browser.

In many other cases, this trick is useful too. Web devs, for example, will make a domain solve for the localhost address on their device. If you have a home LAN, you will be able to open the device by its name from File Explorer if you map a network device to its IP address with the Hosts file. This is useful if your network devices run a naked distro that does not include Windows names that can identify over the network.

What is Hosts File?

The Hosts file can be edited by any text editor as a standard text file. The only thing to catch is that the app editor is big (as Administrator). The host’s file is in the device folder and is not saved by non-existent applications.

The Hosts file is made up of text lines. The first text column, followed by one or more hostnames, must provide an IP address for each line. The columns of text are separated by white space from each other. For a historical reason, it’s always preferable to <Tab>, but spaces are often used. Comments are lines that began with a hash (#) character. In the hosts’ register, Windows does not know blank.

How to Block a Website on Windows 10 Using Hosts File

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 is the easiest method to block websites on Windows 10 and it’s free and doesn’t require to download and install any additional software or extensions. It’s an easy way to restrict people of all ages from seeing content that you don’t want to see.

So, without further ado, here’s how to block websites for all browsers in Windows 10 using a host file:

Step 1. Type Cmd in the search bar next to the start menu. Then right-click on Command Prompt select Run as administrator. If you’re prompted, click yes.

Step 2. Now, type “notepad c:\WINDOWS\system32\drivers\etc\hosts” without the quotes in the command line then press enter.

Advertisements
How to Block a Website in Windows 10 Using Host File (Chrome, Edge...)
Command Prompt

Step 3. Scroll to the end of the text file in Notepad. Type 127.0.0.1 followed by a space then the name of the website you want to block. For instance, 127.0.0.1 www.instagram.com or instagram.com Repeat this step for each website you want to block.

How to Block a Website in Windows 10 Using Host File (Chrome, Edge...)
Add a Website to Block

Step 4. After adding websites to the block list, click “File” in the Notepad menu bar and then “Save” to save to file when you are finished adding each website. Then close Command Prompt and Notepad.

How to Block a Website in Windows 10 Using Host File (Chrome, Edge...)
Save

Step 5. Now open your web browser and go to instagram.com. You will see “This site can’t be reached, www.instagram.com refused to connect.”

How to Unblock a Website

So by now, you have learned how to block a website on Windows 10 using the host file. But sometimes, you may want to unblock those blocked websites again. To unblock websites on Windows 10, simply follow the below steps:

  • Run Command Prompt as an administrator.
  • Type notepad c:\WINDOWS\system32\drivers\etc\hosts and press enter.
  • Select the blocked website and choose Delete.
Delete the Blocked Websites
  • After deleting the website/websites from the list, click “File” in the Notepad menu bar and then “Save” to save to file when you are finished adding each website. Then close Command Prompt and Notepad.

Final Words

This was all about how to block a website on Windows 10 using a hosts file. This was the easiest and free method to block websites on Windows 10 and it doesn’t require any additional software or extensions.

Read Next

Advertisement

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button