Why does terminal have "nintendo 3ds" after login?

User uploaded file

Why does it say nintendo 3ds? I haven't made any changes recently...I just noticed it today.

MacBook Pro (15-inch Mid 2010), Mac OS X (10.7.3)

Posted on Nov 8, 2012 7:02 PM

Reply
4 replies

Nov 9, 2012 6:35 AM in response to leahgracej

The Terminal runs the 'bash' shell. The bash shell default command line prompt uses \h in the PS1 shell variable which tells bash to display the host name.


bash does a reverse DNS lookup using your nn.nn.nn.nn IP address to get the host name. This effectively causes the Mac to ask your local DNS server if there is a DNS name associated with your nn.nn.nn.nn IP address. If the DNS server does not have an answer, Mac OS X will get the name from System Preferneces -> Sharing -> Computer name.

HOWEVER, if the DNS server says, YES, I have a name for nn.nn.nn.nn, then that is what gets displayed by bash as your computer name.


You are using a College network where DHCP is going to reuse IP addresses from day to day, so somewhere in the recent past, someone was using their Nintendo DS3 and it managed to tell the local router/DNS server it had a name, and that was remembered. Then today, you connected your Mac, and fired up Terminal, and bash asked for your name, and the rouer/DNS server said "Sure, we have a name for that address", and bash displayed "Nintendo DS3".


If you want to always control your Terminal prompt, then in your .bash_profile (you will need to create it), add


PS1="the name you want> "


Or you can get fancy and us something like:


PS1="$(networksetup -getcomputername)> "

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.

Why does terminal have "nintendo 3ds" after login?

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