Windows Hosts File Optimizer - gHacks Tech News

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.

Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:


Previous Post: «
Next Post: »

Comments

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

    HostsMan is a brilliant little freebie!

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

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

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

    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:

    127.0.0.1 http://www.onj
    127.0.0.1 onj
    127.0.0.1 http://www.pu
    127.0.0.1 pu
    127.0.0.1 http://www.yes
    127.0.0.1 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
      Reply

      I had to edit the domain names. Lets look at http://www.ghacks.net as an example. .net is the top level domain, ghacks is a subdomain of that and www is a subdomain of ghacks. Both http://www.ghacks.net and ghacks.net 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 example.com is sufficient to block all requests to subdomains as well. I think I remember that the hosts file supports wildcards, e.g. *.example.com 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
    Reply

    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:
    http://vlaurie.com/computers2/Articles/hosts.htm

    3. This site says that you CAN use wildcards:
    http://www.ezlan.net/host.html

    So:
    127.0.0.1 *.sitename.com

    SHOULD be equivalent to the two entries of:

    127.0.0.1 http://www.sitename.com —AND—
    127.0.0.1 sitename.com

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

    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

Please note that your comment may not appear immediately after you post it.