The "hosts" file customization
The hosts file is used to establish correspondence between IP address and a domain locally. Information stated there has the highest priority and is spread only within the computer where this file is edited. Contents
1. Where the hosts file is located?To find the hosts file in the system will be no trouble. In case of Linux this file is located in the following directory: /etc/hosts In Windows operating system destination path to the hosts file may be changed in the registry, which one can access with the editor regedit. One can run it the following ways: 1) Start Menu > Run > regedit > OK; 2) Windows + R > regedit > OK. The record we are interested in is located in: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\DataBasePath
2. How is the hosts file supposed to look like?By default in clear system there is no value in the hosts file but solely commended lines (started with # symbol) with the file description. 3. How to edit the hosts file?
One can check introduced changes for functionality by putting the stated domain into a browser or by pinging it in a command line. 4. How to save the hosts file?Sometimes there is a situation when the hosts file will not be saved and all introduced changes will not work. This situation emerges in several cases:
5. How to comment out the line in the hosts file?To commend out a line one uses the symbol “#”, puts it at the beginning oft the line and thus terminates operation of the record in the line. This method is convenient in case when some record may be needed in the future, or when there is a need to add some text with description. Also, a comment may be added not only at the beginning of the line, but for example, after IP address and a domain name. Now working with hosts is over. |