Terminal is showing you the first label of your BSD hostname (assuming your shell is BASH). If your BSD hostname is yourhostname.mynetwork.com
then Terminal will display only yourhostname
-
So from where does the BSD hostname come? It can come from several places:
• from the file: /etc/hostconfig
• else from the file: /Library/Preferences/SystemConfiguration/preferences.plist
(System ▸ System ▸ HostName)
• else the result of a reverse DNS query for your primary IP address (so you might notice a totally different hostname showing up when you visit an internet café than when connected at home)
• else your "Bonjour" hostname in System Preferences > Sharing (preferences.plist
again... System ▸ Network ▸ HostNames ▸ LocalHostName)
• finally, if none of the above have been set, the BSD hostname will be simply localhost
By the way, I answered the same question a while ago over here: Mac OS X Terminal - where does the prompt name come from
hostname
into the prompt and press enter. What do you get? – Blender Nov 14 '11 at 4:27