How to edit Host file on 10.7.1?

Discussion in 'Mac OS X Lion (10.7)' started by antilife, Oct 5, 2011.

  1. antilife macrumors newbie

    Joined:
    Oct 5, 2011
    #1
    Whatever trick that is out there only works for 10.7 to edit the Host file, now with this new update, there is no way to edit the Host file on 10.7.1!!! is there any other way that I'm not aware of?

    Tnx if you can share any solution here.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I don't see anything different with the hosts file in 10.7.1. I can access and edit the same way as usual: vim /etc/hosts

    Maybe you can be more specific about how you're trying and any error messages you're getting.
     
  3. antilife thread starter macrumors newbie

    Joined:
    Oct 5, 2011
    #3
    I used sudo command for reaching host file, I didn't know about vim command, what that does?
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    vim is just an editor (probably shouldn't use it if you don't know what it is). You can use other editors to edit the file though such as nano.
     
  5. derbothaus macrumors 601

    derbothaus

    Joined:
    Jul 17, 2010
    #5
    or pico.
     
  6. antilife thread starter macrumors newbie

    Joined:
    Oct 5, 2011
    #6
    some how nano and any other way of editing was blocked, so I just used GAS MASK and it did the job for me.

    are you running 10.7.1 ?
     
  7. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #7
    Yes, I double-checked and I have 10.7.1. Not sure what gas mask is, but glad you found something to edit it with.
     
  8. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #8
    There is no "pico" on the Mac. If you type "pico" in Terminal you get "nano".

    The command to use is:

    sudo nano /etc/hosts

    S-

    R.I.P. Steve......
     
  9. antilife thread starter macrumors newbie

    Joined:
    Oct 5, 2011
    #9
    http://www.macupdate.com/app/mac/29949/gas-mask

    that's the GUI and easy program I used.

    I used nano editing, but when I changed the host file and tried to save it by cmd+X it didn't respond!!! I guess I was rushed and just wrote the sudo part not the sudo nano! honestly I thought they patched the host file again so there is not way to edit it. since you are doing fine then it means I did something wrong on my end.
     
  10. iWind130290 macrumors member

    Joined:
    Aug 30, 2011
    Location:
    Ha Noi, Viet Nam
    #10
    I still use the old trick:
    Finder >>> Go >>> type /etc >>> drag host file into desktop >>> remove the host file in etc folder >>> open and edit the host file at desktop >>> drag the edited host file into etc folder again.
    This trick still works as well.

    R.I.P. Steve......
     
  11. derbothaus macrumors 601

    derbothaus

    Joined:
    Jul 17, 2010
    #11
    Well...damn. I just looked at the top, GNU nano 2.0.6.
    Old habit typing pico I guess. Never looked at the top bar.:confused:
    sudo pico /etc/hosts = same thing.
     

Share This Page