Changing the Host Name


I seem to remember that under the OS X Public Beta, it was easy to change the host name of an OS X computer. For example, my computer's name is DeepBlu. It shows up under Appleshare on another computer as DeepBlu. But, if you open a terminal on my machine, it shows up as "localhost."

Is there a way to set the name of the host to DeepBlu? I can't seem to find which configuation file needs to be changed. If I had to guess, I would say it's /etc/hostconfig, but doesn't the host name there have to be a valid name that DNS servers won't object to?


I thought all you had to do was 'append value' or something like that...

then it shows, "deepblu, localhost" as the value

I also added the machine name in the hostconfig file, too. I think you have to do that if you want to get sendmail working as well...

How does the value look when you make a copy?

......haha, I guess I can just try... shouldn't be a problem as long as I don't save it.


Dis Member
just do sudo hostname deepblu (or whatever)


mach-o mach-o man
You can do it in netinfo, too. Just look under 'machiens' or whatever, and where it says 'localhost' and '' change localhost to whatever you want, or just add another entry under with your custom hostname.


To change the hostname open, su to Root or use sudo depending on how your system is set up and edit /etc/hostconfig using vi. In there you will see a section which reads like this:

# Network configuration

Change the HOSTNAME= line to read as what ever you want your hostname to read. So for my machine it reads


When you reboot your system the new hostname will have taken effect. It overrides whats listed under netinfo.


What works for me:
Edit this file and change everyinstance of "localhost" with your preferred hostname:


Not graceful but it gets the job done.