Thursday, February 18, 2010

Changing hostname in macos

Stop DHCP screwing up your Mac OS X hostname

I'v got Snow Leopard, but DHCP is screwing my hostname all the time to something very random. Another thing that /etc/hostconfig goes away, while System Preferences in the Sharing tab does not sets hostname as hostname. Thus all older recipes are not really applicable anymore, once you're on Snow Leopard (I love changes). The cure is how to setup your hostname to, e.g. "Zeus" (that's mine one) like this (terminal and sudo privileges are required):

sudo scutil --set ComputerName zeussudo
scutil --set HostName zeussudo
scutil --set LocalHostName zeus