You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal shows old computer name (after migration)

After using migration assistant (over Thunderbolt) – from a MacBook Pro 5,4 to a MacBook Pro 11,4 – Terminal shows the old computer name at the prompt. This happens despite updating the computer name in System Preferences' Pane for Sharing. I've scoured the Console and the System Report.

MacBook Pro with Retina display, macOS High Sierra (10.13.3)

Posted on Mar 20, 2018 12:01 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 20, 2018 12:26 PM

The bash shell will do a reverse DNS lookup using your current IP address. If a DNS server responds with a name, then bash will display that as the computer name.


You could try

sudo scutil --set HostName "name-of-host"


You could reboot your home router, or in some way get whatever is acting as your DNS server to forget what it knows.

3 replies
Question marked as Top-ranking reply

Mar 20, 2018 12:26 PM in response to walter.dufresne

The bash shell will do a reverse DNS lookup using your current IP address. If a DNS server responds with a name, then bash will display that as the computer name.


You could try

sudo scutil --set HostName "name-of-host"


You could reboot your home router, or in some way get whatever is acting as your DNS server to forget what it knows.

Mar 20, 2018 12:39 PM in response to walter.dufresne

In any of the "dot" files in your home directory (e.g. .bashrc, .bash_login, .bash_profile, .profile), and assuming you are using Bash as your default shell — are you manually setting your old hostname anywhere in these files?


Is your /etc/resolv.conf file showing your expected DNS server entry?


If you do nothing, and use VPN, your hostname will be automatically set to the DNS server's assigned hostname, and will bypass the Sharing panel entry. The /etc/resolv.conf will automatically be updated with the VPN DNS server address.

Terminal shows old computer name (after migration)

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