# How do i edit the HOSTS file.



## mAd_pC_wIz (Mar 11, 2004)

How do i edit the HOSTS file. like what do i add to the bottom to redirect websites


----------



## Ratboy (Feb 12, 1999)

mAd_pC_wIz,

Welcome to TSG!

Open the HOSTS file in Notepad for editing.

In order to "redirect" a URL that you type, to another page, add a line using the following format:

*24.137.12.208 www.whatever.com*

IP address is the address that you want the browser redirected to, when you type in the URL.


----------



## hewee (Oct 26, 2001)

Look here

http://accs-net.com/hosts/eDexter.html

I use and love edexter. Also use the hpHOSTS file and it is blocking just over 30,000 address.
http://www.dozleng.com/updates/index.php?showforum=78


----------



## mAd_pC_wIz (Mar 11, 2004)

ok but what if i am running win32 and it trys to save it as a txt file and does not open as a txt file all the time cause i have todo that "open with..." thing every time i open it it wont let me check that little bot off that says "always use these programs withe these files"


----------



## angel (Dec 2, 1998)

Windows determines which application to use based on the file extension. The hosts file does not have an extension so the option to "always use this program..." will not be available. If opening and editing directly, you'll need to choose Open With... Notepad each time.


----------



## hewee (Oct 26, 2001)

With edexter you will not get the open with because it knows and will use notepad to open it. But once the hosts fill gets bigger then your see a error box that it can not use notepad and it will ask you if you want to use Wordpad. 
Now I also have HostsToggle that I use to make backups of my hosts file.
http://accs-net.com/hosts/HostsToggle/
You can use it to edite the hosts file also but I only run it for backups and use it when I need to get to a site that is blocked by the hosts file because it lets you disable the hosts file. You have to close down IE or netscape etc sometimes and clear the temp or cache so it does not use it but then you can get to the sites that you had blocked. I then go to the sites and after I am done I enabled the host file again.
But HostsToggle also lets you edit the hosts file and if it is too big to use notepad it just opens in wordpad without the error box. Also it is good to use when you want to replace the hosts file or have more then one hosts file because you can change from one to another. Lots of the hosts files you download are a text file and you can use it to open them. Just click load hosts file and under the files type pick hosts file. Then it will when you save it replace your hosts file. But it is a great program for backup etc.
Just make a folder to put HostsToggle in because there is no install or anything but it makes the backups in what ever folder the program is in so make a folder for it.


----------



## brinybay (Feb 6, 2005)

Another question on the subject. I'm trying to wean myself off of Adsubtract because I'm getting tired of having to report every third or fourth site I visit because it didn't block the banner ad or pop up. I read about using the HOST file to block unwanted pop-ups and banner ads. I downloaded a HOST file from http://www.mvps.org/winhelp2002/hosts.htm. I know how to open it and what the format should be, but I don't know how to find the info I need. Problem I'm having is I think it's doing too good of job on one site, and not effective on another, more specifically, it seems to be blocking certain images on my home page (myway) such as the news photos, which are OK, but it's not blocking the banner ad on a Yahoo group I frequent.

How do I find out what info I need to put in the HOST file to correct that?


----------



## brinybay (Feb 6, 2005)

brinybay said:


> Another question on the subject. I'm trying to wean myself off of Adsubtract because I'm getting tired of having to report every third or fourth site I visit because it didn't block the banner ad or pop up. I read about using the HOST file to block unwanted pop-ups and banner ads. I downloaded a HOST file from http://www.mvps.org/winhelp2002/hosts.htm. I know how to open it and what the format should be, but I don't know how to find the info I need. Problem I'm having is I think it's doing too good of job on one site, and not effective on another, more specifically, it seems to be blocking certain images on my home page (myway) such as the news photos, which are OK, but it's not blocking the banner ad on a Yahoo group I frequent.
> 
> How do I find out what info I need to put in the HOST file to correct that?


I found half the answer on my own. For the news photos, I right clicked the image, then properties, and looked at the address that it was retrieving it from, in this case ak.imgfarm.com. I then opened the host file in notepad, searched for the address, and put a # in front of the entry, saved the host file, and restarted the computer.

The Yahoo group ad banner is a different story. When I right click it, it gives info on macromedia flash player, no properties option. Not sure what to do there.


----------



## hewee (Oct 26, 2001)

Any line in your hosts file that start with # is not read.
You need to have for each site you want to block have the line start with 127.0.0.1
Like 127.0.0.1	ads.com
127.0.0.1	doubleclick.com
Do not add the http://

I use edextar, hpHOSTS file that blocks a lot more sites then others do, like over 35,000. 
See my post above too on HostsToggle.

The hpHOSTS forum has moved to a new site.
http://www.hosts-file.net/


----------

