How to block websites using hosts file
Find out about hosts file
File hosts play an important role in computers. It is used to map based on hostname and domain name to corresponding IP addresses.
File Hosts offers many handy options for dealing with network buttons that you can use file hosts to block useless advertisements, distracting pop-up windows, banners, web pages. pornography, or even redirects to other websites that users don't want.
The following tutorial will guide you how to block websites with hosts file :
Step 1: Find the hosts file on the computer
You can open the hosts file in either of the following ways:
- Method 1:
+ For computers using the Windows operating system, you can find the hosts file by the following "C: WindowsSystem32driversetchosts".
+ For computers using Unix / Linux operating system: the hosts file is located at "/ Etc / hosts"
- Method 2:
Do a host file search by searching quickly on your computer by typing in the Search progarms section and find the following path ' C: WindowsSystem32driversetc ' as shown below:
Step 2:
You should save the hosts file to a safe place, in case we edit the hosts file, it may cause a system error. Once you've found the host file, open the hosts file with the file editing software included in the file. eg computer notepad and add parameters to edit the hosts file.
If you want to block a website, you just need to add the following command at the end of the hosts file in your computer:
127.0.0.1 xyz.com
Where xyz.com is the website you want to block and then save the file.
How the command line works is when you visit a website with the address xyz.com, your computer will be redirected to access your own computer. Because your computer does not have a web server, that connection will fail. Hence it can block websites you don't want.
For example, if I want to block dantri.com.vn, I can simply add the hosts file to the command line as shown below:
Do the same you can block any website you want to block. Good luck.
You should read it
- 6 simple ways to enable the right-click feature to block that site
- How to block websites on Firefox
- How to Block Websites on Google Chrome
- Simple and fast steps to edit Host File on Windows 10
- How to Block Websites on Firefox
- Does Viettel block websites that contain 18+ videos and images on computers and phones?
- Instructions on 2 ways to quickly block websites from opening automatically
- How to block websites on Chrome simple, effective
- How to block websites that open on Coc Coc 100% successfully
- How to Block and Unblock Internet Sites (On a Mac)
- Steps to block automatic opening of websites on Chrome browser
- How to Block Unwanted Sites from Your Router