3

My terminal prompt on OS X 10.8.3 suddenly is not the machine or hostname anymore but something like:

minint-j4lfb2s:~

Where does that come from? I did not change it. How can that be?

gronostaj
  • 58,482
Joe D
  • 31

2 Answers2

0

I've seen this happen on a few macs (including my own once), where the mac's "Computer Name"/"Local Hostname" gets corrupted.

Check System Preferences -> Sharing, and seem what the "Computer Name" text box. Then check the text under that to see if the "Local Hostname" is correct; if not, click the "Edit..." button to it's right.

demure
  • 6,550
0

The hostname can also be determined by a reverse DNS lookup (see this thread).

You can set a static hostname with sudo scutil --set HostName newname. It adds or changes the System:System:Hostname key in /Library/Preferences/SystemConfiguration/preferences.plist. Another way is to add HOSTNAME=newname to /etc/hostconfig.

Related questions:

Lri
  • 42,502
  • 8
  • 126
  • 159