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.
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.
AdvertisementPlease click on the following link to open the newsletter signup page: Ghacks Newsletter Sign up
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.
HostsMan is a brilliant little freebie!
I ended up with 50% CPU usage from svchost.exe because of this. Thanks, but no.
correct.a huge merged hosts file is going to take up some memory unfortunately….I’ve decided to use the pi-hole.net 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….
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.
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.
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
can anybody provide a direct link to download host optimizer