Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Edit Host File in Mountain Lion?

How to edit the host file in mountain lion?

iMac, OS X Mountain Lion

Posted on Nov 7, 2012 5:57 PM

Reply
Question marked as Best reply

Posted on Nov 7, 2012 6:17 PM

  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
12 replies
Question marked as Best reply

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

Nov 8, 2012 5:51 AM in response to Kasee

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.

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.

Edit Host File in Mountain Lion?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.