Change hostname in Mac OSX

sudo scutil --set HostName yourHostname.local