A few words of thanks would be greatly appreciated.

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.

To consider

  • If the address is (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 :
  • IPV6 : ::1

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

Why change 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, 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:


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:
# rhino.acme.com # source server
# x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 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:    gromozon.com   xearl.com td8eau9td.com mioctad.com mufxggfi.com uv97vqm3.com coeds.com* lah3bum9.com* cvoesdjd.com*

Once completed, your file should be like this:

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.

  • 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 (your computer's IP) .
  • Try pasting the in the web browser. -  - -

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: boxore.com =>Adware.Boxore
O1 - Hosts: www.boxore.com =>Adware.Boxore
O1 - Hosts: boxore.org =>Adware.Boxore
O1 - Hosts: www.boxore.org =>Adware.Boxore
O1 - Hosts: boxore.net =>Adware.Boxore
O1 - Hosts: www.boxore.net =>Adware.Boxore
O1 - Hosts: dlmanager.com =>Adware.Boxore
O1 - Hosts: eorezo.com =>PUP.Eorezo
O1 - Hosts: www.eorezo.com =>PUP.Eorezo
O1 - Hosts: dist.eorezo.com =>PUP.Eorezo
O1 - Hosts: file.eorezo.com =>PUP.Eorezo
O1 - Hosts: log.eorezo.com =>PUP.Eorezo
O1 - Hosts: ads.eorezo.com =>PUP.Eorezo
O1 - Hosts: prof.eorezo.com =>PUP.Eorezo
O1 - Hosts: soft.eorezo.com =>PUP.Eorezo
O1 - Hosts: upd.eorezo.com =>PUP.Eorezo
O1 - Hosts: dfr.eorezo.com =>PUP.Eorezo
O1 - Hosts: lollipop-network.com =>Adware.Lollipop
O1 - Hosts: www.lollipop-network.com =>Adware.Lollipop
O1 - Hosts: download.lollipop-network.com =>Adware.Lollipop
O1 - Hosts: offers.lollipop-network.com =>Adware.Lollipop

You can use one of the softwares below 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.


  • Download Hoster.
  • Unzip on desktop.
  • Launch Hoster and click on Restore Microsoft's Hosts File.

Rogue Killer

  • Download Rogue Killer.
  • Launch the tool.
  • Select Restore hosts file.

Photo: © Everypixel


A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « How to edit the hosts file », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).