12 Replies Latest reply: Mar 24, 2014 9:49 PM by jkendrick Branched to a new discussion.
Kasee Level 1 Level 1 (20 points)

How to edit the host file in mountain lion?


iMac, OS X Mountain Lion
  • Yuengdog1983 Level 1 Level 1 (115 points)
    1. Launch Terminal , found in /Applications/Utilities/ or launched through Spotlight
    2. Type the following command at the prompt:
    3. sudo nano /private/etc/hosts
    4. Enter the administrator password when requested, you will not see it typed on screen as usual with the command line
    5. Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
    6. When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano
    7. Quit out of Terminal when finished
  • Barney-15E Level 8 Level 8 (39,840 points)

    Use TextWrangler (from Bare Bones website, not App Store). It will allow you to authenticate the file to make changes. There may be other text editors that do that, but I don't know. TextEdit won't.

     

    The file is in /etc

  • etresoft Level 7 Level 7 (25,525 points)

    Kasee wrote:

     

    How to edit the host file in mountain lion?

    Why do you want to do that? The few people with a legitimate need to edit the hosts file already know how to do that.

     

    If you explain what you are trying to accomplish by editing the hosts file, we can give you a much better solution.

  • Yuengdog1983 Level 1 Level 1 (115 points)

    Editing the hosts file can resolve sign in issues with Facetime Messages and Game Center.

    http://support.apple.com/kb/TS3970

  • etresoft Level 7 Level 7 (25,525 points)

    Yuengdog1983 wrote:

     

    Editing the hosts file can resolve sign in issues with Facetime Messages and Game Center.

    http://support.apple.com/kb/TS3970

    No. That support document says exactly the opposite - that editing the hosts file can cause sign in issues with Facetime Messages and Game Center.

  • Kasee Level 1 Level 1 (20 points)

    My issue got sorted out by editing the hosts file. There are applications (for example SAP Enterprise Portal) requires you to modify your hosts file without that it will not work.

     

     

    ** By the way it is safer to edit if we know why and what are we editing **

     

    From Apple notes:

    If you have edited your /private/etc/hosts file, you should remove or comment out any entries containing apple.com or verisign.com. To comment them out, put a "#" character (without quotes) and a space at the start of any line containing apple.com or verisign.com. Note: Some third-party software installers may modify the hosts file without alerting you.

  • ds store Level 7 Level 7 (30,315 points)

    I've explained a simpler GUI friendly method here

     

    TextWrangler from BareBones is far eaiser to edit, with copy and paste ability

     

    Stop a Mac from connecting to certain sites

  • Mactastik Level 1 Level 1 (0 points)

    @ ds store

    unable to access your link

  • raybies Level 1 Level 1 (0 points)

    @et-al:

    It's pretty easy once you know the BIG secret.

    Download TextWrangler

     

    1.- Open Finder

    2.- Press Shift + Cmd + G

    3.- Type /etc

    4.- Enter

    5.- Right click hosts

    6.- Open with > TextWrangler

     

    <Edited By Host>

  • Barney-15E Level 8 Level 8 (39,840 points)

    raybies wrote:

     

    @et-al:

    It's pretty easy once you know the BIG secret.

    Download TextWrangler

     

    1.- Open Finder

    2.- Press Shift + Cmd + G

    3.- Type /etc

    4.- Enter

    5.- Right click hosts

    6.- Open with > TextWrangler

     

    <Edited By Host>

    The newest version of TextWrangler has a "Show hidden items" on the Open dialog. So, you can then get to anywhere in the file system. It used to have an Open Hidden command, so if you have an older version, you can use that to open the file directly.

  • Faslane Level 1 Level 1 (5 points)

    not true. It worked like a champ for me as well. Let's not ask why when we're just prying with no real help offered eh?

  • jkendrick Level 1 Level 1 (0 points)

    The answer by by Yuengdog1983 worked jes fine for me!

    THANKS, Yuengdog!

     

    MacBook Pro i7, OS X 10.8.5