spacer
Search
Sign up for free
Login
  • High-Tech
  • Health
  • Sign up for free
  • Language
    • English
    • Español
    • Deutsch
    • Français
    • Italiano
    • Português
    • Nederlands
    • Polski
  • Login
    Identification

    ( forgot? )

-->
spacer
Follow us spacer
spacer
To receive the newsletter
Recherche
Well being and health care
Discover
Ask a question »

How to edit the hosts file

spacer USspacer ESspacer DEspacer FRspacer ITspacer BRspacer NLspacer PL
May 2015

spacer

How to edit the hosts file

The hosts file (/etc/hosts on Unix based system) is the first step in the translation of a FQDN hostname to the IP address format.
When making a DNS request on any address server on the web, this file is queried first. For each name present in this file, a connection will be opened to the defined IP address. It works just like a telephone directory.
  • If that address is 127.0.0.1 (my PC) the connection will be made on localhost
  • If a server exists on your PC, it will access the latter. If the server doesn't exist, nothing happens.

The IP address of the localhost is written as:
  • IPV4 : 127.0.0.1
  • IPV6 : ::1

On devices with IPv6 enabled, so you can use both. You can modify the hosts file to block access to certain websites.

Why changing the hosts file?

The hosts file is viewed each time you connect to a website, much like a directory of addresses. If the site is listed in the hosts file and has its IP address set to 127.0.0.1, then access will be blocked. By cons, if the website isn't listed in the hosts file, your ISP will automatically connect you to the IP address of the requested website. By modifying the hosts file, you can:
  • Prohibit access to certain sites,
  • Accelerate access to your favorite website (for which you know the IP address).

How to modify the hosts file?

The hosts file is located here:
C:\WINDOWS\system32\drivers\etc\hosts
A clean hosts file looks like this:
  
# 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost


To edit the hosts file:

To block a website using the host file:
  • Type the IP address, followed by a TAB space and the website name.

127.0.0.1    gromozon.com           
127.0.0.1 xearl.com
127.0.0.1 td8eau9td.com
127.0.0.1 mioctad.com
127.0.0.1 mufxggfi.com
127.0.0.1 uv97vqm3.com
127.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:
spacer


You can add all the addresses you want, but if your hosts file becomes too large, it may cause some issues with the DNSClient service of Windows (which puts the svchost process at 99% in your Task Manager). You can disable this service if you wish to use a large hosts file:
  • Click on Start > Run
  • Type services.msc
  • Select DNSClient > "Disable"


You can also make use of a predefined template. E.g the MVPS hosts file: 26,000 entries.
  • Some addresses are blocked in your firewall (IP Range).
  • To summarize, when you try to connect to a listed website, the computer will redirect to 127.0.0.1 (your computer's IP)
  • Try pasting the 127.0.0.1 in the explorer.


195.225.176.0 - 195.225.179.255          
85.255.112.0 - 85.255.127.255
66.230.175.0 - 66.230.175.255

How to restore the hosts file to its default values

Some malwares tend to modify the hosts file, redirecting you to another server, usually an infected one. They can also block access to websites, such as online anti-virus.
O1 - Hosts: 0.0.0.0 boxore.com =>Adware.Boxore
O1 - Hosts: 0.0.0.0 www.boxore.com =>Adware.Boxore
O1 - Hosts: 0.0.0.0 boxore.org =>Adware.Boxore
O1 - Hosts: 0.0.0.0 www.boxore.org =>Adware.Boxore
O1 - Hosts: 0.0.0.0 boxore.net =>Adware.Boxore
O1 - Hosts: 0.0.0.0 www.boxore.net =>Adware.Boxore
O1 - Hosts: 0.0.0.0 dlmanager.com =>Adware.Boxore
O1 - Hosts: 0.0.0.0 eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 www.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 dist.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 file.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 log.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 ads.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 prof.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 soft.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 upd.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 dfr.eorezo.com =>PUP.Eorezo
O1 - Hosts: 0.0.0.0 lollipop-network.com =>Adware.Lollipop
O1 - Hosts: 0.0.0.0 www.lollipop-network.com =>Adware.Lollipop
O1 - Hosts: 0.0.0.0 download.lollipop-network.com =>Adware.Lollipop
O1 - Hosts: 0.0.0.0 offers.lollipop-network.com =>Adware.Lollipop

You can use one of the below softwares to restore the hosts file:

Myhosts (by jeanmimigab)

  • Its main advantage is its compatibility Windows 95 / 98 / ME / 2000 / XP / Vista / 7.
  • Just download it and run it.
  • Note: No need to disable UAC or run as administrator under Vista / 7.
  • Official Website

RstHosts (byXplode)

  • RstHosts is compatible with Windows 95 / 98 / ME / 2000 / XP / Vista / 7 (x86 and x64)
  • Download here .
  • Start, then click Restore.

Hoster

  • Download Hoster: www.funkytoad.com/download/HostsXpert.zip
  • Unzip on desktop.
  • Launch Hoster and click on Restore Microsoft's Hosts File.

Rogue Killer

  • Download Rogue Killer: www.sur-la-toile.com/RogueKiller/
  • Launch the tool.
  • Select Restore hosts file.
For unlimited offline reading, you can download this article for free in PDF format:
spacer
How-to-edit-the-hosts-file.pdf

See also

  • How to edit the hosts file
  • Forcing a domain name with the hosts file » How-To - Network
  • Change the default installation folder (C: \ Program Files) » How-To - Windows
  • Configuring Apache and Windows to create a virtual host » How-To - Apache
  • Espier Notifications 7 Pro » Download - Professional
  • Audio editing software (free download) » Download

In the same category

  • How to format a virus via DOS?
  • How to get rid of Actulice/ No ModF/ Funk Popups
  • How to remove "NewFolder.exe" virus?
  • How to remove autorun.inf file?
  • How to remove Khatra.exe virus?
  • How to remove the virus CONFICKER / DOWNADUP / KIDO?
  • How to remove Virut?
  • Lsass.exe application error
  • MalwareByte's automatic update
  • Online scanning using F-secure
spacer
Modificar el archivo Hosts
By Carlos-vialfa on April 30, 2008
spacer
Hosts-Datei bearbeiten
By jedtheboss on January 4, 2013
spacer
Modifier son fichier hosts
By Thom@s on April 9, 2007
spacer
Come modificare il file hosts
By nane77 on September 12, 2009
spacer
Como modificar seu arquivo Hosts
By pintuda on April 17, 2009
spacer
Mijn hosts bestand wijzigen
By Jeff on July 29, 2013
spacer
Edycja pliku hosts
By technomix on April 18, 2014
Original article published by Thom@s. Translated by jak58.
This document entitled « How to edit the hosts file » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.
Previous

Virus - System Volume Information

Next

Deleting Rootkits

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.