Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 192009
 

Mac OS X: How to Add Hosts to Local Hosts File

Mac OS X 10.0 through 10.1.5

  1. Open /Applications/Utilities/NetInfo Manager.
  2. To allow editing the NetInfo database, click the padlock in the lower left corner of the window.
  3. Enter your Admin password and click OK.
  4. In the second column of the browser view, select the node named "machines." You will see entries for -DHCP-, broadcasthost, and localhost in the third column.
  5. The quickest way to create a new entry is to duplicate an existing one. So select the "localhost" item in the third column.
  6. Choose Duplicate from the Edit menu. A confirmation alert appears.
  7. Click Duplicate. A new entry called "localhost copy" appears, and its properties are shown below the browser view.
  8. Double-click the value of the ip_address property and enter the IP address of the other computer.
  9. Double-click the value of the name property and enter the hostname you want for the other computer.
  10. Click the serves property and choose Delete from the Edit menu.
  11. Choose Save from the File menu. A confirmation alert appears.
  12. Click Update this copy.
  13. Repeat steps 6 through 12 for each additional host entry you wish to add.
  14. Choose Quit from the NetInfo Manager menu. You do not need to restart the computer.

Source: http://support.apple.com/kb/TA27291