Wednesday, June 15, 2011

How to modify the hosts file

 Why change the hosts file?



The hosts file is consulted each time you connect to a website, much like a directory of addresses. If the site is listed in the list of hosts file, access is blocked if the address is 127.0.0.1. By cons, if not found in the file, your provider (ISP) which connects with the IP address of the site requested.
By modifying the hosts file, you can:Prohibit access to certain sites,accelerate access to the sites you prefer and which you know the IP address,circumvent the prohibition of access to security sites caused by some malware.
Change the hosts file is simple, free, harmless and reversible.

How to modify the hosts file?
Where is the original hosts file?
The original hosts file is located here:
 
C: \ WINDOWS \ system32 \ drivers \ etc \ hosts
What does it contain?
It should contain this if it is intact:
 ---------------------------------------------------------------------------------------------------
 
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 on an individual line. The IP address should be placed# In the first column followed by the corresponding host name.Address# IP and host name should be separated by a space.## Additionally, comments (such as this one) may be inserted on individual# Lines or following the machine name. They are indicated by the# '#' Symbol.## For example:## # Source server 102.54.94.97 rhino.acme.com38.25.63.10 x.acme.com # # x client host
127.0.0.1 localhost
-------------------------------------------------------------------------------------------------------
If you have the same text as above, it is clean, but it does not serve much!

Modification method


The first thing to do is open your favorite text editor such as notepad in administrator mode. This is done by clicking the Start Menu -> right click on WordPad for example -> Run as administrator.


Once the text editor open, go to File -> Open and navigate to the host file (C: \ WINDOWS \ system32 \ drivers \ etc \ hosts).
Now let's do something useful, add sites to block:Select this: (note that within a tablulation (TAB) between 127.0.0.1 gromozon.com)
127.0.0.1 gromozon.com127.0.0.1 xearl.com127.0.0.1 td8eau9td.com127.0.0.1 mioctad.com127.0.0.1 mufxggfi.com127.0.0.1 uv97vqm3.com127.0.0.1 coeds.com *127.0.0.1 lah3bum9.com *127.0.0.1 cvoesdjd.com *
Once completed, your file should be like this:


Obviously you can add all the addresses you want.
There are also lists of hosts made all ...Be careful though, if your hosts file becomes large, it may be a problem with the service ClientDNS of Windows that would duplicate (which puts a 99% svchost process in your Task Manager), therefore, caution ....
We just have to disable this service if you wish to use a large hosts file:Start / Run / type services.msc / search the right column ClientDNS / set "disable"
Example here:
26,000 entries.
Wait until the file is completely loaded, then choose Save As:C: \ Windows \ system32 \ drivers \ etc \ hosts
http://speedweb1.free.fr/download/secu/hosts.ZIP file (8 Mega)
Some addresses are blocked in your firewall:(IP Range)
To summarize, if you stumble on the Net on one of these places, right columns, the computer will redirect to 127.0.0.1 (your computer's IP)Try pasting the line 127.0.0.1 in your Explorer to see the result!
195.225.176.0 - 19522517925585.255.112.0 - 85,255,127,25566.230.175.0 - 66,230,175,255
Restore the hosts file to its original state
Some malware modifies the hosts file to redirect to another server, usually trapped. They can also block access to useful sites, such as anti-virus online, so as to make the disinfection of the machine more difficults.To restore the hosts file to its original state, you can use one of these programs:
1 / myhost (from jeanmimigab):
Its main advantage is its compatibility Windows 95 / 98 / ME / 2000 / XP / Vista / 7Just download it and run it.Note: No need to disable UAC or run as administrator under Vista / 7.Official Website myhost(Article posted by philo2100)
2 / RstHosts (of Xplode)
Like myhost, RstHosts is compatible with Windows 95 / 98 / ME / 2000 / XP / Vista / 7 (x86 and x64)RstHosts download at this addressStart, then click [Restore].

3 / Hoster:Hoster Download here: http://www.funkytoad.com/download/HostsXpert.zipUnzip the file on the desktop.Run Hoster and click Restore Microsoft's Hosts File
4 / Rogue Killer

Rogue Killer Download here: http://www.sur-la-toile.com/RogueKiller/Run the downloaded fileAt the command prompt, select option 3 "Restore the Hosts
5 / Zeb restore under Windows 2000 and XP
link here: http://telechargement.zebulon.fr/zeb-restore.html
6 / ZhpfixZhpfix ZHPDiag supplied to restore the host file by using the Hostfix (outlined in pink in the picture)