How to change your hostname in Mac OSX Lion
By default, you get the horribly user friendly Mac hostname in the terminal. To change that, do the following as root:
scutil --set HostName hostname_you_like
Of course, replace hostname_you_like with something you want. Source: Larry Gordon.