• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

whats a host file

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Cjwinnit

B&
Joined
Feb 1, 2003
Location
UK
A HOSTS file is a file kept in Windows machines that overrides DNS settings.

Whenever you type in a domain name (like for example, www.ocforums.com ) the browser will check the HOSTS file to see if there is an entry for that domain. If there isn't an entry, and only then, it will connect to the internet name server and find the IP adress.

Windows XP machines have the file in C:\Windows\System32\Drivers\Etc\. Open the file "HOSTS" in notepad.

See the "127.0.0.1 localhost" entry? That's the first one. Whenever you edit the HOSTS file, ALWAYS leave that entry and leave it as the first one.

To add a domain to block, add another line with 127.0.0.1 and the domain to block after it.

So, for example, if you were to edit it to be
Code:
127.0.0.1  localhost
127.0.0.1  [url]www.ocforums.com[/url]

then whenever you typed in "www.ocforums.com" the browser will be directed to connect to your own computer.

Hosts files are an extremely effective way of blocking ads and cookies, though trojans can get around it. It won't stop cookies if they connect to an IP address though, it's only a domain-alterer.
 
Last edited:

Lat

Member
Joined
Mar 1, 2004
Location
Vancouver (Canada)
if you use firefox, i wouldn't bother using the host file...
there are extensions which absolutely rock, and easily are better than blocking with the host file

i use this one myself:
http://adblock.mozdev.org

blocks absolutely everything =) and the collapse feature rocks too

Edit: if you decide to use adblock, pm me if you want to use my list of filters... :D
 

Kendan

Senior Punk
Joined
Aug 27, 2001
Location
Dark side of hell
Lat said:
if you use firefox, i wouldn't bother using the host file...
there are extensions which absolutely rock, and easily are better than blocking with the host file

i use this one myself:
http://adblock.mozdev.org

blocks absolutely everything =) and the collapse feature rocks too

Edit: if you decide to use adblock, pm me if you want to use my list of filters... :D

Except it will only work in firefox:( The hosts file works for the whole computer.

Here is a link for some more info on the Hosts file: http://www.accs-net.com/hosts/what_is_hosts.html
 
Last edited:

Kendan

Senior Punk
Joined
Aug 27, 2001
Location
Dark side of hell
dalek2.0 said:
Also works for Mozilla. :D Me got it already. Works too. :D

Later

:D :D

I was just making sure people reading this thread understood that they are two different things. One is for the whole computer one is just for that browser.

FYI, you already have a hosts file too;)
 

dalek2.0

Member
Joined
May 25, 2004
Location
Mississippi USA
Thought that would be obvious. It installs it in the Mozilla directory after all. The host file is there weither you have a browser or not, at least in Linux. I don't know what windoze has.

Anywho, now they know for sure.

:D :D :D