Terminal command changed for host file with Lion??

Discussion in 'Mac OS X Lion (10.7)' started by aziatiklover, Sep 18, 2011.

  1. aziatiklover macrumors 68030

    aziatiklover

    Joined:
    Jul 12, 2011
    Location:
    8.8.8.8 and 8.8.4.4
    #1
    So I usually change my host file and for some reason since I upgrade SL to Lion I can't no longer enter this command "sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts" can someone pst the right command for Lion plz thanx.
     
  2. axu539 macrumors 6502a

    Joined:
    Dec 31, 2010
    #2
    If I remember correctly, it's actually just a bug in Lion that messes with host file editing. I used gas mask, and it worked, so you might want to just try that instead.
     
  3. killerrobot macrumors 68020

    killerrobot

    Joined:
    Jun 7, 2007
    Location:
    127.0.0.1
    #3
    Yeah Lion blocks the opening of the file through text edit now.
    Either use the program axu539 suggested or go into terminal (logged in as admin) and do it manually by typing:

    sudo nano /etc/hosts
     
  4. aziatiklover thread starter macrumors 68030

    aziatiklover

    Joined:
    Jul 12, 2011
    Location:
    8.8.8.8 and 8.8.4.4
    #4
    So is it a bug or Apple blocking it with Lion? If it's a bug I'm sure it's gonna get fix next software update right?
     
  5. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #5
    I use pico to edit the host file and I don't have any issues with that.
     
  6. gyorpb macrumors member

    Joined:
    Sep 15, 2011
    Location:
    Amsterdam
    #6
    Instead of directly editing the hosts file, work on a copy and only copy it to /etc once you are done. To really be on the safe side, first mv your existing hosts file to a backup, hosts.20110919 if you were to do this today, for example.

    .tsooJ
     

Share This Page