3 Replies Latest reply: Aug 27, 2010 4:18 PM by sethish17
sethish17 Level 1 Level 1 (0 points)
Im currently trying to add to my hosts file (/Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts) and every time go press save is says i dont have permission to do that then says go to file>get info to change it but since im in text edit i cant. ive tried unlcking every thing but nothing seems to work. oh and im the admin and it still wont let me do it.

Anyone have any solutions, please?

MacBook Pro, Mac OS X (10.6.4)
  • 1. Re: Hosts file won't let me save.
    Niel Level 10 Level 10 (242,110 points)
    Use TextWrangler to edit it and authenticate yourself.

    (53506)
  • 2. Re: hosts file wont let me save.
    Antonio Rocco Level 6 Level 6 (10,190 points)
    Hi

    You should not really edit the file in /etc with TextEdit. Besides you should try and back up the file first anyway. What you should use is a Terminal editor such as nano or pico or vi etc. Launch Terminal and issue:

    sudo cp /etc/hosts /etc/host.bak


    When prompted key in the local admin accounts password. You won't see it being typed so don't worry. That makes a copy of the hosts file just in case you screw things up. Next issue:

    sudo nano /etc/hosts


    Navigate using the arrow keys to a place where you can make your changes. It will be the line following the entry that looks a bit like this:

    fe80::1%lo0 localhost


    Control+O will write any changes you made. You'll be prompted to confirm the change. Press the enter key to confirm. When the change has been made Control+X will exit the editor. Quit Terminal when you're done.

    Why do you need to edit the hosts file anyway? The interface is more than capable of handling DNS lookups.

    Tony
  • 3. Re: Hosts file won't let me save.
    sethish17 Level 1 Level 1 (0 points)
    it worked thanks!