Skip navigation

Edit Host File in Mountain Lion?

45786 Views 12 Replies Latest reply: Mar 24, 2014 9:49 PM by jkendrick RSS Branched to a new discussion.
Kasee Level 1 Level 1 (20 points)
Currently Being Moderated
Nov 7, 2012 5:57 PM

How to edit the host file in mountain lion?

iMac, OS X Mountain Lion
  • Yuengdog1983 Level 1 Level 1 (115 points)
    Currently Being Moderated
    Nov 7, 2012 6:17 PM (in response to Kasee)
    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 7 Level 7 (33,270 points)
    Currently Being Moderated
    Nov 7, 2012 6:19 PM (in response to Kasee)

    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 (23,890 points)
    Currently Being Moderated
    Nov 7, 2012 6:39 PM (in response to Kasee)

    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)
    Currently Being Moderated
    Nov 7, 2012 6:50 PM (in response to etresoft)

    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 (23,890 points)
    Currently Being Moderated
    Nov 8, 2012 4:51 AM (in response to Yuengdog1983)

    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.

  • ds store Level 7 Level 7 (30,305 points)
    Currently Being Moderated
    Nov 8, 2012 6:58 AM (in response to Kasee)

    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)
    Currently Being Moderated
    Dec 26, 2012 11:03 PM (in response to ds store)

    @ ds store

    unable to access your link

  • raybies Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jun 15, 2013 5:00 AM (in response to etresoft)

    @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 7 Level 7 (33,270 points)
    Currently Being Moderated
    Jun 15, 2013 5:47 AM (in response to raybies)

    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 (0 points)
    Currently Being Moderated
    Mar 19, 2014 11:00 AM (in response to etresoft)

    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)
    Currently Being Moderated
    Mar 24, 2014 9:49 PM (in response to Yuengdog1983)

    The answer by by Yuengdog1983 worked jes fine for me!

    THANKS, Yuengdog!

     

    MacBook Pro i7, OS X 10.8.5

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.