Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Is there an OS X hosts file that I can edit? System
[Editor's note: Please see the comments for the proposed solution]

I'm using OS X Public Beta as my primary web development environment - that is I develop the html/code using my OS X box. Now, my web servers and my desktops are behind a firewall and DNS hosting has been outsourced to AT&T, so resolving my webservers' URLs "within" my network isn't possible without modifications being made to a desktop's hosts file. Under Windows and Mac OS 9 its easy -- just make the changes to the file. But the hosts file I found in "/etc" under OS X says it "isn't used" and modifications don't take hold.

Does anyone have a suggestion or know the right way to go about doing this?
    •    
  • Currently 1.33 / 5
  You rated: 3 / 5 (9 votes cast)
 
[72,757 views]  

Is there an OS X hosts file that I can edit? | 4 comments | Create New Account
Click here to return to the 'Is there an OS X hosts file that I can edit?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Adding host entries to OS X
Authored by: tomsinclair on Nov 23, '00 06:48:59PM

As a long-time UNIX geek, I was also
puzzled by the fact that /etc/hosts on OS X
didn't appear to work correctly.

However, I finally figured out that OS X
uses a special database known as
NetInfo for all of its network information.
(Hence the name.)

Anyway, to modify this you have to use a
program called NetInfo Manager which
should be in your Utilities folder. When
you open it, you'll be presented with a
browser-type view of such information as
hosts, users, etc.

To add a host entry, you have to click on
the category labelled 'machines' which
will then display a list of the know hosts
for your computer. The easiest thing to
do is to make a copy of an existing entry
and then modify the name and IP
address for the copy to match that of the
host you're trying to add. (You'll have to
authenticate as an administrator to make
changes.)

I know this sounds kind of weird but I'm
just beginning to study NetInfo and still
learning myself.



[ Reply to This | # ]
Adding host entries to OS X
Authored by: j-beda on May 11, '01 03:22:43PM
There might be more useful information at this hint:
http://www.macosxhints.com/article.php?story=20010328234510985.

[ Reply to This | # ]
Is there an OS X hosts file that I can edit?
Authored by: davenasralla on Aug 20, '08 07:43:09AM

Leopard (10.5x) uses the normal hosts file.



[ Reply to This | # ]
Is there an OS X hosts file that I can edit?
Authored by: nikolaisen on Aug 20, '08 08:37:45PM

I'm trying to edit the hosts file as well. Its in the /etc/hosts location, but I don't have access to the file. When I type su, it does not take my password. Whats the trick to this?



[ Reply to This | # ]