Mac OS X: Change your hostname
Here are two ways to change your hostname in Mac OS X.
The first, open a new terminal and type this:
sudo hostname <new hostname>
Note: You will be asked for your password, because you are performing this command as root
The second, go to System Preferences -> Sharing -> Computer Name.
The first option will be more immediate.