PDA

View Full Version : Mac OS X hosts file?



Lincoln
6th November 2005, 07:31 PM
I run a server on the same network as my Mac's, thus I have to be able to resolve the domain name to an internal IP address.

On the Windows machines this is simply done with the hosts file, so does Mac OS X have a similar thing?

eyeLikeCarrots
6th November 2005, 07:43 PM
If you start the 'nmbd' service your macs should be able to respond to WINS name requests

I'll hunt around for that file... i know its there somewhere

neilrobinson
6th November 2005, 07:46 PM
Hi,

Its located @ /etc/hosts

neil

Lincoln
6th November 2005, 07:53 PM
.... where is /etc?!

mac_man_luke
6th November 2005, 08:08 PM
hidden ;)

press apple+shift+G and type the path in there or use the terminal

staph
6th November 2005, 08:08 PM
It's a hidden folder.

In the Finder, hit cmd-shift-g and type /etc/, and it will take you there.

You need to be authenticated with root permissions to edit it, so you'll either need to use a tool which can edit with admin privileges, like SubEthaEdit, or you can use a command line tool like nano, vi, or emacs, as so:

sudo nano /etc/hosts

sudo vi /etc/hosts

etc.

Currawong
6th November 2005, 08:09 PM
Core system files are hidden in the Finder. You can access them via the terminal. You might, in the terminal, say, type: sudo pico /etc/hosts

This would allow you to edit the file. Control-X quits pico - then just follow the prompts. The "sudo" bit elevates your authority to that of the root (admin) user.

Wheels
6th November 2005, 08:27 PM
Interesting! I never knew that there were hidden folders like that on my Mac! I've never used that cmd-shift-g shortcut either!

Lincoln
6th November 2005, 08:34 PM
Thanks guys. Got it. :thumbup:

mac_man_luke
6th November 2005, 09:40 PM
Originally posted by wheels8989@Nov 6 2005, 08:27 PM
Interesting! I never knew that there were hidden folders like that on my Mac! I've never used that cmd-shift-g shortcut either!
If you enable hidden files with tinkertool for example you will find the layout is almost identical to linux/bsd. Prolly cos its derived from them ;)