How to block websites in Windows 10 with file hosts

How to block websites in Windows 10 with file hosts

The world of the internet is a collection of numerous websites that made everything digital. But not all of these websites may be suitable for everyone. Suppose you want to prevent your friends or children from opening a certain website on your computer. Simply telling them to stop opening them wouldn't be a great solution. If you think you need to manually block certain sites to change certain settings on your system, here it is. This article will guide you perfectly through the steps required to achieve this.




But before we continue, let me introduce you to a new term File host di Windows. Host names connected to a network must be mapped to their respective IP addresses. This is done to uniquely identify a particular system in a group of systems connected to the Internet. This Windows hosts file is responsible for providing this mapping function. Small changes made to this file can help you block the particular website. Well, now let's start discussing the process.

Read also: - How to limit PC usage time for one account in Windows 10

STEPS TO BLOCK WEBSITES BY EDITING THE WINDOWS HOST FILE

Step 1 - Open your file explorer and copy and paste the path provided below into the address bar and navigate to the folder etc.

C: Windows System32 drivers ecc

How to block websites in Windows 10 with file hosts

Step 2 -

Now, right click and copy the hosts file and paste it elsewhere on your computer. We copy and paste on the desktop.

How to block websites in Windows 10 with file hosts


3 pass - Go to desktop and right click and click Open with.



How to block websites in Windows 10 with file hosts

4 pass - Now choose Notepad as the option to open the file with Notepad.

How to block websites in Windows 10 with file hosts

5 pass - Once the file is open, scroll down and copy and paste these two lines at the bottom. Just make sure you rename the website with the name of the file you want to block.


127.0.0.1 www.websitename.com

127.0.0.1 websitename.com

For example, if you want to block Facebook, enter the code as shown below.

How to block websites in Windows 10 with file hosts

PHASE 6


Now save the changes to the file. Now copy and paste it back into the file etc binder. The original file will be replaced.

How to block websites in Windows 10 with file hosts

PHASE 7

How to block websites in Windows 10 with file hosts

How to redirect a blocked website to another website

Now suppose you need to open any other website when your friends secretly try to open the site you opposed. Let's see how it can be done.


  • Open Command Prompt and type ping sitename.com. The site name is the name of the site you want to be redirected to. For example, suppose you need to redirect to google.com, you can type ping google.com. This will give you the IP address of the site.

How to block websites in Windows 10 with file hosts

As shown above, I got the address from google.com.

  • Now as described above, instead of adding 127.0.0.1 at the end of the notepad, you can add

IP address websitename.com

The IP address is the address you currently received from the command prompt, and the website name is the name of the site you want to redirect to another site.

How to block websites in Windows 10 with file hosts

In my case, I am redirecting the hello.com site to the Google site which has the IP address 216.58.220.40. From now on, the Google site opens when you search for hello.com.

add a comment of How to block websites in Windows 10 with file hosts
Comment sent successfully! We will review it in the next few hours.