How to fix the hosts file

How to fix the hosts file

All kinds of problems with logging into sites when you can't log into Odnoklassniki, the contact reports that his account is locked for suspected hacking and asks for a phone number, then a code, and finally , withdraw money from your account, are most often due to malicious changes in the system Hosts file.

There are many ways to fix the hosts file in Windows and all of them are quite simple. Let's look at three of these ways that are probably enough to put this file in order. 2016 Update: Windows 10 Hosts File (How to Change, Restore, Where to Find It).

Table of Contents

Pinning Hosts in Notepad

The first method we are going to look at is how to fix the hosts file in notepad. This is probably the easiest and fastest way.

First of all, run Notepad as administrator (this is required, otherwise fixed hosts will not be saved), for which:

  • In Windows 7, go to "Start" - "All Programs" - "Standard", right-click on Notepad and select "Run as administrator".
  • In Windows 8 and Windows 8.1, on the start screen, start typing the first letters of the word "Notepad", the search bar on the right will open. Right click on Notepad and select "Run as administrator".

The next step is to open the hosts file, for this select "File" - "Open" in the notepad, at the bottom of the opening window change from "Text documents .txt" to "All files" , go to the folder C: {Windows} System32} Drivers and open the file houses.

Note that if you have multiple hosts files, you should open the one with no extension.

The last step is to remove all unnecessary lines from the hosts file, or just paste their original content into the file, which you can copy, for example, from here (and at the same time see which lines are unnecessary).

# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # # source server # # x client host # localhost name resolution is handled within DNS itself. # localhost # ::1 localhost

Note: the hosts file may be empty, this is normal, so nothing needs to be fixed. The text of the hosts file can be in both Russian and English, it doesn't matter.

After that choose "File" - "Save" and save the fixed hosts (may not save, if you run notepad not as administrator). It is also advisable to restart the computer after this action for the changes to take effect.

How to fix hosts in AVZ

Another easy way to fix hosts is to use the AVZ antivirus utility (it can go much further, but only host fixation will be covered in these instructions).

You can download AVZ for free from the developer's official website (look for it on the right side of the page).

Unzip the file with the program and run avz.exe, then select "File" - "System Restore" in the main menu of the program and check an option "Clean Hosts File".

Then click on "Perform the marked operations" and, when finished, restart your computer.

Microsoft Fix it utility to restore the hosts file

And the last way is to go to for the hosts file recovery page and download the utility that is available there Setting it to automatically restore this file to its original state.

Also, on this page you will find the original content of the hosts file for various operating systems.

Creative Stop All About Technology
A How To.