PDA

Просмотр полной версии : How to correct HOSTS-file?



PavelA
26.01.2007, 11:54
As Wikipedia (http://en.wikipedia.org/wiki/HOSTS) informs:

The hosts file is a computer file used by an operating system to map hostnames to IP addresses. This method is one of several methods used by an operating system to locate network nodes on a computer network. On many operating systems, the host file content is used preferentially over other methods, such as the Domain Name System (DNS). Unlike DNS, the hosts file is under the control of the local computer's administrator.

If you don't use special DNS-settings, you should clean hosts file.
Some programs (e.g. Spybot Search & Destroy, Ad-Aware & so on) change them to prevent the connections from your PC to the well-known bad sites.
The problem here is, that the quantity of bad sites rises prompter, as database update by security tools and the hosts file after 4-5 updates will be too large.
That is why we recommend you to hold hosts file as written.

With Hijackthis

Start HijackThis (http://www.tomcoyote.org/hjt/).
Choose Config... (down on the right side)/MiscTools/Open hosts file manager/Open in Notepad.
The file will be opened for edition in Notepad.
Delete all strings excepted

127.0.0.1 localhost
If the such string does not exist, you have to add it.

VERY IMPORTANT::: Additionally only for Vista/Windows 7

Pls. check/add the next string


::1 localhost

With AVZ (from Oleg Zaitsev)

The most simple way to edit HOSTS-file is to execute follow script

begin
ClearHostsFile;
end.
The command ClearHostsFile will find Hosts file, clean all unknown/unnecessary strings (all the comments will not be removed) and add the string

127.0.0.1 localhost
I integrated this feature in AVZ: Menu File/System Restore, Checkpoint 13

Rene-gad
22.08.2009, 18:56
If you have to do with an XXL-hosts file or you cannot clean it with AVZ-Script, you'd like to:
- start any text editor (e.g. Notepad);
- Open a new document
- Mark and Copy code - in dependence of used operation system:

If you use Windows XP


# Copyright (c) 1993-1999 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

If you use Windows XP with IPv6, Vista or Windows 7


# Copyright (c) 1993-1999 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
::1 localhost

- Save this document as %WINDIR%\system32\drivers\etc\hosts WITHOUT EXTENSION. Confirm the re-writing of the old file

%windir% - OS - directory, normally C:\WINDOWS

PS: Any command, which had been written after sign # will not be executed and serves only as comment or user information.