Host File Editing in Mac OSX Lion+ and Previous Versions

OSX 10.7 Lion+:

  • Utilities>Terminal>New Terminal Window:

sudo nano /private/etc/hosts

  • Move cursor to end and enter to get an extra blank line of space
  • Append your new mappings (e.g. 127.0.0.1 – Local Host)
  • Hit Ctrl+O to save
  • Hit Enter to select name on bottom
  • Hit Ctrl+X to close the editor
  • Flush Cache:

sudo dscacheutil -flushcache

  • Restart

Previous OSX’s:

  • Utilities>Terminal>New Terminal Window

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit/etc/hosts

  • Append your new mappings (e.g. 127.0.0.1 – Local Host)
  • File> save
  • Flush Cache:

sudo dscacheutil -flushcache

  • Restart
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s