Where is the hosts file and how to find it - this question is often asked by experienced users who need to make edits to it. The hosts file is used to map a called domain to a specified IP address. Typically, this file contains 1 line:
- 127.0.0.1 localhost
Which essentially maps the IP address 127.0.0.1, which is the IP address of the local machine (current computer), to the domain localhost. However, this line in Windows is just for show :) If you delete it, the localhost domain will still map to the specified IP address 127.0.0.1.
[caption id="attachment_1452" align="aligncenter" width="588"]
Where is the HOSTS file[/caption]
Where is hosts located
The hosts file is located in Windows at the path "C:\Windows\System32\drivers\etc".
Attention!
Do not confuse the hosts file with the hosts.ics file, which is intended for completely different purposes. The hosts file has no extension, and this file can also be hidden. We recommend that you enable the display of hidden files in Windows, and then make the hosts file not hidden so that both you and some programs can access it without issues.
How does it work?
As already mentioned, the hosts file sets a mapping of a domain to a certain IP address. It was also mentioned that the IP address 127.0.0.1 is the address of the local machine, i.e., the address of the current machine.
Typically, the localhost address (127.0.0.1) is used by some programs that display information in a WEB view. For example, the address 127.0.0.1 and a certain port of this address are used by the Connectify Dispatcher program to display the speed graph of combined connections.
Try making changes to this file yourself, for example, to redirect a certain site to the local machine. Suppose you want to block access to the site www.example.com, but you don't know how to do it. The hosts file will help you here.
Enter the following information into this file, then be sure to save the changes:
- 127.0.0.1 www.example.com
That's it, now the site www.example.com will point to the local machine, meaning it will not be accessible. And if you reserve a certain port on this address and attach a Listener to that port, you can even display some custom information. For example, a message "This site is unavailable." This is how access is blocked for key verification in some programs, such as Techsmith Camtasia Studio.
To trick this program, the following information is specified in the hosts file:
- 127.0.0.1 activation.cloud.techsmith.com
The specified domain is the key verification address for Camtasia. That is, the program will try to access its verification center, and Windows will redirect it to the local machine. The program will thus think that there is no internet connection and will skip the verification procedure for the keys entered by the user.
The hosts file is also used by the software product Denwer, popular among developers, which allows running the Apache Web server with PHP and MySQL installed on it to test scripts on the local machine, i.e., without an internet connection.
You might be interested in programs for working with the system:
- Download Glary Utilities for free
- Download CCleaner for free
- Download Gpu-z
- Download Ammyy Admin for free
Good luck!