By default, the host name of your computer is not set. The Sharing panel lets you set the computer name, which is a Mac OS X-specific attribute. My theory is that if the host name is not set, hostname
(and your shell prompt) will use this value instead. The following is the output of scutil
and hostname
on my laptop.
patikoija ~ % scutil --get ComputerName
patikoija
patikoija ~ % scutil --get LocalHostName
patikoija
patikoija ~ % scutil --get HostName
HostName: not set
patikoija ~ % hostname
patikoija.local
When I visit my company's office, my host name is similarly set to something that begins with 'dhcp-'. I suppose that the DHCP server sets the actual host name, and running scutil
there would show that name. You can try using scutil
to set the true host name of your computer, and see if that "resists" efforts by the DHCP server to override it.