Changing hostname in OSX
In what is sure to be a chronic occurrence, I was frustrated by OSX pretending to act like Linux without actually doing the same thing. Specifically this time I wanted to change the hostname. The following sort of does it but not really:
- sudo hostname <newhostname>
According to a post at the bottom of this blog, the following are also necessary:
- sudo scutil --set LocalHostName
- sudo scutil --set ComputerName
- sudo scutil --set HostName
In addition, it's necessary to go into [System Preferences] -> [Sharing] and change the 'Computer Name'.
And all of that won't get around the name provided by DHCP, depending on the DHCP server's config.
(note that this applies to Leopard 10.5.2)