As most Windows 10 users don’t confront the need to touch hosts file on their machines, there are many like you who feel the urge for modification in them so that the unwanted sites can be obstructed from being operated on your browser. But prior to delving into the action, we should take a tour of what exactly you will be doing while modifying the hosts file and what will be the consequences of the alterations.
Hosts File in Windows 10 is basically a text file deeply-seated in your system’s Windows folder but you will not be able to perceive .txt extension with the names in it and the route to it is –
The original file is around 824 bytes in size and the function of this file is to map user-friendly host names to their relevant IP addresses so you can surf them on the internet. When you obstruct a web page inside this file, you won’t be able to access it anymore and these sites are those that you don’t desire to visit for your own reasons.
Let’us see how to Modify Hosts Files in Windows 10 to Block Websites or unblock on a machine forasmuch to restrain or liberate them from accessing via any browser.
How to Modify Hosts Files in Windows 10
Before you commence the journey of modifying hosts file, you need to fulfill two requisite things –
- Be an administrator to carry out the modifications as only he has the full power to pull through this task.
- Provisionally disable all antivirus programs as these can be resistant to the current procedure.
Once you are done with the above two conditions, you are ready to proceed with the steps –
- Travel to this place
C:\Windows\System32\Drivers\etcand perform a right click on the entry that is described as hosts and from the resultant contextual menu, opt for Open with.
- Again a separate menu will be apparent with the list of apps that can open the file, opt for Notepad and thereon click Ok.
- The output window will be of a Notepad with some sort of text, and numbers.
Block a website using Hosts File in Windows 10
- To restrict or prevent a singular (one) site, you need to input its entry into the end of the file.
- To block twiitter.com, in the observable Notepad, write 18.104.22.168 twitter.com after the last line.
- Soon after adding the line, strike File and thereon opt for Save to save the alterations.
- Open the web browser and put effort to access that website (twitter.com) and you will witness that it is being obstructed from appearing and thus will not be perceivable.
Unlock the website using Hosts File in Windows 10
- Now, in near future, if a thought triggered your mind to remove the restriction from the site, simply open the hosts file in Notepad and wipe out the entry of the URL and thereupon save the changes.
- Check and take a glimpse of the website.
Note: While experimenting on How to Modify Hosts Files in Windows 10, we have noticed the websites are not being blocked by 127.0.0.1 IP, the local host one and thus gave a trial with 0.0.0.0 and 22.214.171.124 and guess what? It was on strike!! 0.0.0.0 is a default IP address whereas 126.96.36.199 is a normal public IP address.
We have these two IP addresses to block to separate websites, 0.0.0.0 was assigned to obstruct www.linkedin.com and 188.8.131.52 was used for twitter.com.
Now, we came across another very interesting thing in this procedure is that while trying to use linkedin.com to block the website, the hosts file did not obstruct it but when tried with www.linkedin.com, the site was blocked instantly and the same is the case with Facebook.
We are concluding this article here with a hope that with the above-furnished information and steps for how to Modify Hosts Files in Windows 10 to Block Websites you will be able to carry out the modification of hosts file successfully. We are always here to help you out, so you can put your thoughts and doubts in the comments form below.