I need to add an alias to hosts file

I need to add an alias in the form of 123.123.123.123 target_name In Windows this would simply mean adding a line to the Hosts file. Looking through these forums it looks more involved in OS 10.6. Netinfo Manager seemed to be what was needed but I'm now directed to the 'dscl' command. I have looked through man dscl but I can't find the exact form of the command. I even tried to add the line to existing /etc/hosts file but it wouldn't let me write the changes (:w!)


Any specific help would be very welcome. Thanks

24" 3.06 GHz Intel iMac, Mac OS X (10.6.4), iPod Classic; iPhone 4; ATV2; 15" MBP

Posted on May 18, 2011 6:46 AM

Reply
2 replies

May 18, 2011 7:30 AM in response to Martin Crawley1

You need to be using an administrator account to edit the /etc/hosts file, as that file is owned by root and not editable by any other user. If you use the free (and excellent) TextWrangler to edit the file, it will prompt you to authenticate for access and will allow you to edit the file. I believe you can also use TextEdit for this, but as TextEdit is a far less capable editor and I never use it, I don't know the steps required there.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I need to add an alias to hosts file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.