Windows Hosts File Optimizer

The Windows hosts file is used to map hostnames to IP addresses forcing the computer to use that mapping instead of the one provided by the DNS server. This can be useful in several situations like speeding up Internet surfing or making sure that a website is working fine after moving it to another Internet server before the new IP has propagated.

The Windows hosts file is basically a text document that lists IP addresses on the left and hostnames on the right. The hosts file is located in system32/drivers/etc/ of the Windows folder. It can be edited with any text editor.

windows hosts file

Optimizing the hosts file can speed up the parsing of the file and keep the DNS client service enabled while using a big hosts file.


The hosts optimizer will automatically remove duplicate host names from the hosts file, remove all comments including entries that have been made a comment to disable them and put a maximum of nine host names in a single line if they point to the same IP address.

The program will automatically created a backup of the hosts file before optimizing it. It has to be noted that the DNS cache needs to be flushed whenever a change is made to the Windows hosts file if the DNS Client service is enabled.

Hosts Optimizer can be downloaded from the abelhadigital forum. The program is also part of the hosts manager HostsMan.


Previous Post: «
Next Post: «


  1. Maik said on May 23, 2010 at 5:47 pm

    HostsMan is a brilliant little freebie!

  2. Sérgio Dias said on May 23, 2010 at 7:44 pm

    I ended up with 50% CPU usage from svchost.exe because of this. Thanks, but no.

    1. adam said on February 26, 2021 at 6:29 pm

      correct.a huge merged hosts file is going to take up some memory unfortunately….I’ve decided to use the approach personally….the little raspberry pi now uses my pi zero as it’s DNS server….

      curious though is there such a tool to check to see if this huge list of hostnames is actually valid? some of these hosts files I dont feel actually get validated….

  3. Jojo said on May 24, 2010 at 8:39 am

    I looked at the hosts file tonight.

    I don’t use it myself, but Spybot Search & Destroy does. What I noticed is that Spybot inserts TEO entries for every address in the file, one with www in front and one without. Like this: http://www.onj onj http://www.pu pu http://www.yes yes
    # End of entries inserted by Spybot – Search & Destroy

    Is it really necessary to do what Spybot is doing?

    Obviously, there are twice the number of addresses to process using their methodology which probably slows down anyone doing lookup’s in the hosts file.

    1. Martin said on May 24, 2010 at 9:51 am

      I had to edit the domain names. Lets look at as an example. .net is the top level domain, ghacks is a subdomain of that and www is a subdomain of ghacks. Both and are independent from each other. Most webmasters redirect both to the same domain but that does not have to be the case. About the hosts file. I actually have not tried it if entering is sufficient to block all requests to subdomains as well. I think I remember that the hosts file supports wildcards, e.g. * to block everything from a domain which means my guess would be that the hosts file only blocks the hostname that is shown and nothing else. But I have not verified that.

  4. Jojo said on May 24, 2010 at 8:18 pm

    1. In the past, IE apparently had problems with large hosts files created by Spybot, apparently resulting in problems opening IE (either slow or would not open at all). I personally haven’t seen this problem in a while, yet I have a large hosts file, so it appears that the problem was with IE and not the size of the hosts file.

    2. There is a good write-up on hosts file here:

    3. This site says that you CAN use wildcards:

    So: *

    SHOULD be equivalent to the two entries of: —AND—

  5. Deba said on April 1, 2011 at 4:56 pm

    can anybody provide a direct link to download host optimizer

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.