When I log into the network at my job my Mac’s hostname always turns to:
I have my local hostname set to:
So What I would like to do is set my Mac’s hostname to my local hostname. You can do this all from Terminal in a single line.
Run this command in Terminal:
sudo scutil --set HostName larryx.local
This is also helpful if you’re in Terminal and have a really long hostname at your prompt. If you want to view your current hostname, run this command in Terminal:
Update (February 13, 2012): Some people have reported that their hostname is not updating. Please try closing your current Terminal session and starting up a new one. Then type “hostname” and you should see your changes.