May 11, 2010 0

Finding and Editing Mac OSX Host File

By in How To, Server, Tools

Mac Host File

The most popular reason to edit a host file is to test virtual host configurations.

In order to edit and modify the mac host file you must edit it using terminal.  This is where the file is located.

/private/etc/hosts

In order to edit it open up terminal and enter the following command:

# sudo pico /private/etc/hosts

You may have to enter your user password.  Pico will open up and you should see the following:

Simply edit your entries and save.  You will need to flush your DNS cache as well.

# dscacheutil -flushcache

This post assumes that you know what to do with the hosts file.

Read Also:

  1. Monitor your server using your iPhone and iStat Server
  2. using a host file to test a virtual host apache site configuration
  3. How to SSH without typing in a Password

Tags:

Leave a Reply

Spam protection by WP Captcha-Free