In Mac OS X, you may have noticed if you use the Terminal that OS X automatically picks up what it thinks your hostname should be and sets it. This is nice, but the problem with it is if any utility uses your hostname to set config files, you’ll have a different config file every time.
How to fix a “Strange Hostname” in an OS X Prompt
If you are getting varied prompts that look like this…:
…where what you’re expecting is something like this:
To fix this, you can use scutil. Here’s how I did it:
scutil --set HostName "rickmac.esolia.net"
Substitute the rickmac bit with your own hostname and domain and you’ll be good to go with a static prompt. Try these also:
scutil --get HostName
scutil --get LocalHostName
scutil --get ComputerName
I hope this helps someone. Enjoy!