In windows 7 they are in /windows/system32/drivers/etc/ but where are the host files in Mac Lion OS X located?
$ sudo nano /private/etc/hosts
Step 1 Open the Terminal.app
Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.
Step 2 Open the hosts file
Open the hosts by typing on the Terminal that you have just opened:
Code:$ sudo nano /private/etc/hosts
Type your user password when prompted.
Step 3 Edit the hosts file
Step 4 Save the hosts file
When done editing the hosts file, press control-o to save the file.
Press enter on the filename prompt, and control-x to exit the editor.
Thanx SandboxGeneral. But it keeps asking me for a password even though I haven't setup one up and after 3 attempts it logs me off again. Is there a way around this?
You should have an admin password that you use to log into your Mac or install apps. You should have set it when you first set up your Mac.
I think there's an option in the Open dialog for whether to enable every type of file, or just allow "text" (.txt) files to be opened.i can see the hidden files, but fail to open it.
See my post above about using TextWrangler.Is it required use a terminal-based editor such as nano, vim or emacs? Can you edit root:wheel-owned files with a GUI editor? If you attempt to save, does it ask you for the sudo password, or does it fail?