What is a computer host file and how to edit a host file?

- File host is a file that stores important IP information on the computer and helps the operating system recognize the IP of the server where the specific domain name is managed.

Sometimes you will need to edit the host file on your computer. Through file hosts, you can control access to websites and network traffic.

The host file has been in use since ARPANET. They are used to resolve host names before DNS.

Microsoft keeps the hosts file in the Windows network, which is why it changes so little even if it is used in Windows, macOS or Linux.

The first part will be the location to redirect the address, the second part will be the address you want to redirect and the third part will be the comment. They can be separated by a space, but for readability are usually separated by one or two tabs.

Windows 8 or 8.1 and 10

What is a computer host file and how to edit a host file? Picture 1What is a computer host file and how to edit a host file? Picture 1

If you use Windows 10, the way to edit the host file will look like this:

What is a computer host file and how to edit a host file? Picture 2What is a computer host file and how to edit a host file? Picture 2

When you're done, open the following file using the File -> Open feature: c: windowssystem32driversetchosts

What is a computer host file and how to edit a host file? Picture 3What is a computer host file and how to edit a host file? Picture 3

You can then edit as usual.

Windows 7

To access the hosts file in Windows 7, you can use the following command in Run to open notepad and file.

What is a computer host file and how to edit a host file? Picture 4What is a computer host file and how to edit a host file? Picture 4

When notepad is open, you can edit the file. In this example, we will block Facebook. To do this, simply enter the following after the www.facebook # com

What is a computer host file and how to edit a host file? Picture 5What is a computer host file and how to edit a host file? Picture 5

After editing the host file, save it.

What is a computer host file and how to edit a host file? Picture 6What is a computer host file and how to edit a host file? Picture 6

Now if you try to access Facebook in IE it won't work. We also cannot access Facebook through Google Chrome.

What is a computer host file and how to edit a host file? Picture 7What is a computer host file and how to edit a host file? Picture 7

macOS (Any Version)

In macOS, accessing the host file is also quite easy. Start in the terminal and use the editor.

What is a computer host file and how to edit a host file? Picture 8What is a computer host file and how to edit a host file? Picture 8

The files will look a bit like Windows, though not as intuitive. Again we will block Facebook.

What is a computer host file and how to edit a host file? Picture 9What is a computer host file and how to edit a host file? Picture 9

This time use 0.0.0.0 as a loopback and will direct you to the computer's Apache test page.

4 ★ | 1 Vote