How to change the hosts file in Windows 7, XP, Vista: cleaning the hosts file
Many people had problems with the hosts file when working on a computer. In today's article, we will analyze what kind of file it is, what information it contains and what actions are possible with it.
First of all, you need to understand that our file isresponsibility for matching the names of sites to their IP addresses. For example, using this file you can register a ban on visiting certain sites. However, first you need to find hosts on your computer. Usually, the hosts file is located in the WINDOWSsystem32driversetchosts folder for Windows 7, Vista, and XP.
How the hosts file should look like
Now let's see what the file looks likehosts, what it is, if it is opened. By the way, you need to use a notepad to open it, since it does not have an extension file. Usually the contents of the file look like this:
The last digits (in our case - 127.0.0.1) is the address of the computer on which you opened the file. This is the normal kind of hosts file. If in addition to this information there is something else written in it, then you will have to edit the file to bring it to its original state.
How to change the contents of the hosts file
If you need to change the hosts file(for example, viruses have got into the file), then it can be done very simply. To view the file itself, open it with notepad, then change the necessary information and save the file. Restart the computer. All changes will take effect immediately.
Remember that to make changes to the hosts fileyou must have administrator rights on the computer with which you plan to work. By the way, editing hosts, you can register in it a ban on visiting certain sites.
Thus, for example, you can protecthis child working at the computer, from the information unnecessary for his age. You can register a ban as follows: 127.0.0.1 site.ru This entry should go below 127.0.0.1 localhost (next line).
How to clear the hosts file
Now consider the situation in which you needclear the hosts file. It may be connected, for example, with the fact that it contains a ban on visiting certain sites. In this case, you will be involved in the restoration of your hosts file. The procedure will be very simple and already familiar. To begin with, you need to open a file using Notepad. Next - carefully! - you should delete the records after 127.0.0.1 localhost. And only after that the file can be saved. Reboot the computer - the changes will take effect immediately.
What should I do if the hosts file is empty (without content)?
It can happen that the hosts file that youdecided to change, it will be empty, that is, when you open it with a notebook you will not see anything. To be frightened it is not necessary. This means that in the folder etc there was another file called hosts. And since you do not see it, it means it's hidden. The first thing you need to do in this situation is to see the file, for which in the folder properties, set "show hidden folders, files and disks". After that you will see the second hosts file. The next step is to open the file and work with it.
Author: Katerina Sergeenko













