Mac OS X: How to Add Hosts to Local Hosts File
Mac OS X 10.0 through 10.1.5
- Open /Applications/Utilities/NetInfo Manager.
- To allow editing the NetInfo database, click the padlock in the lower left corner of the window.
- Enter your Admin password and click OK.
- 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.
- The quickest way to create a new entry is to duplicate an existing one. So select the "localhost" item in the third column.
- Choose Duplicate from the Edit menu. A confirmation alert appears.
- Click Duplicate. A new entry called "localhost copy" appears, and its properties are shown below the browser view.
- Double-click the value of the ip_address property and enter the IP address of the other computer.
- Double-click the value of the name property and enter the hostname you want for the other computer.
- Click the serves property and choose Delete from the Edit menu.
- Choose Save from the File menu. A confirmation alert appears.
- Click Update this copy.
- Repeat steps 6 through 12 for each additional host entry you wish to add.
- Choose Quit from the NetInfo Manager menu. You do not need to restart the computer.