« Home | Enable Windows PHP Logging to a File » | Change the Site Identifier in IIS » | When Terminal Services Sessions Are Full » | Capture a printer port in Windows XP » | Manage Outlook's Address Book » | Proliant ML330 Hard Drive Performance Boost » | Windows Environment Variables » | Fixing Outlook's Reminders » | Troubleshooting Firefox » | Reset Your iPod » 

Sunday, April 09, 2006

Creating Hosts under Mac OS X

Under UNIX systems, normally your hosts file is located in /etc/hosts - this is not the case in Mac OS X. The recommended procedure you'll normally see online is to use the Net Info Manager, an application under the Utilities folder. While this isn't difficult, it's certainly not as fast as editing a text file using emacs or vi.

Thankfully Apple started using hosts files starting in Jaguar (10.2). To do it, open up a terminal session and do the following commands:
cd /private/etc
sudo emacs hosts
You will be prompted for your administrator password since this file is accessible to root by default. Once there you just need to add the IP address, hit tab, and then key in the domain as follows:
192.168.0.1 your.host.com
Save the file in the editor (Ctr-X, Ctrl-S in emacs and :wq in vi) and you should now be able to resolve the host properly.

E-mail this post



Remember me (?)



All personal information that you provide here will be governed by the Privacy Policy of Blogger.com. More...

Add a comment