Terminal shows iPhone instead of MacBook Pro

I'm relatively new to Mac, but otherwise computer literate. Have had occasion to go into Terminal to try to execute a couple of commands, but... everytime I open Terminal, it shows iPhone as the computer name instead of my MacBook Pro. I haven't connected an iPhone to this MacBook in months (and in fact I no longer even own that iPhone). How did this get changed, and more importantly, how can I change it back to the proper path?

MacBook Pro (13-inch Late 2011), OS X Mountain Lion (10.8.2)

Posted on Dec 13, 2012 9:29 PM

Reply
1 reply

Dec 14, 2012 6:50 AM in response to art_vandelay29

The 'bash' shell does a reverse DNS lookup on your IP address, and then displays that as your computer name. If no external DNS server responds, then the Mac will use the name in System Preferences -> Sharing


So there is a good chance your home router is your local DNS server, and it has associated your IP address with your iPhone, and is returning that name when 'bash' ask what name is associated with your IP address.


You can ignore this if you want. It is harmless.


You can try beating up your home router for being stupid.


You can create a 'bash' initialization file and specify your own prompt


nano ~/.bash_profile

PS1="$(networksetup -getcomputername):\W \u\$ "


which will always return your System Preferences -> Sharing computer name


Message was edited by: BobHarris

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal shows iPhone instead of MacBook Pro

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.