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.

How to block websites using hosts file Picture 1

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".

How to block websites using hosts file Picture 2

+ 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:

How to block websites using hosts file Picture 3

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:

How to block websites using hosts file Picture 4

Do the same you can block any website you want to block. Good luck.

4 ★ | 2 Vote | 👨 355 Views

Above is an article about: "How to block websites using hosts file". Hope this article is useful to you. Don't forget to rate the article, like and share this article with your friends and relatives. Good luck!

« PREV POST
NEXT POST »