Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   Switcher Hangout (http://www.mac-forums.com/forums/switcher-hangout/)
-   -   Hosts Files? (http://www.mac-forums.com/forums/switcher-hangout/20468-hosts-files.html)

vonedaddy 06-20-2005 07:56 PM

Hosts Files?
 
I am a long time windows user and I am new to the mac so please bare with me.

With my windows xp machine I used to have a HOSTS file where I can store DNS information locally and the browser would check there for DNS resolution before going to the DNS servers. Is that possible with a MAC?

technologist 06-20-2005 09:15 PM

It's at /etc/hosts

If the above confuses you, then do the following:
- Open the Terminal application (In the Utilities folder, inside the Applications folder of your hard disk)
- type
Code:

open /etc/hosts
and press Return
The Hosts file should open in a text editor.

PowerBookG4 06-20-2005 10:44 PM

I am interested in what you are changing in this file, a description would be much apprieated so I can learn something.

rman 06-21-2005 09:01 AM

He maybe adding an entry to the file. An entry would look something like the following (ip address hosts name):

123.32.12.125 gandalf

technologist 06-22-2005 01:25 AM

Quote:

Originally Posted by PowerBookG4
I am interested in what you are changing in this file, a description would be much apprieated so I can learn something.

1. Shortcuts, like localhost.
2. Ad blocking. For example, redirect all request to ads.advertiser.com to 127.0.0.1, and web ads from that advertiser will disappear. (You can find lists of popular advertisers' servers, like Doubleclick's, on Google)
3. Filtering. Suppose your roommate shares your iMac. Suppose he likes porn. Suppose you don't want him browsing porn on your computer. Redirect all requests to www.hisfavoritepornosite.com to 127.0.0.1

PowerBookG4 06-22-2005 08:13 AM

that is prety cool, how did you do this on the pc, because I would like to do that on my pc as well.

egandolfi 01-25-2007 06:52 PM

PowerbookG4,
The host file on a pc is located at c:\windows\system32\drivers\etc\

The file name is hosts (no file extension). If you use notepad to edit, make sure when you save you save it as "hosts" including the quotes otherwise it will ad a .txt extension and won't work.


All times are GMT -4. The time now is 09:56 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.