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?

3
  • What does your sudo nano /private/etc/hosts says? Commented May 30, 2013 at 13:24
  • Never touched that. It has the default entries I guess - (127.0.0.1 localhost, 255.255.255.255 broadcast, ::1 localhost, fe80::1%lo0 localhost)
    – Joe D
    Commented May 30, 2013 at 13:39
  • Figured out now, that it always happens when I am sitting in the office (of my new client). Is that a nt-domain thing? Is that normal? Back home everthing is fine again.
    – Joe D
    Commented Jun 5, 2013 at 7:47

2 Answers 2

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.

1
  • "Computer name" and hostname - both present and correct. Hostname equals computer name plus ".local".
    – Joe D
    Commented May 30, 2013 at 13:42
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:

2
  • I am sure there are ways to set a hostname. Right now I am just scared and wonder how it happend. And where this cryptic name comes from - where is it defined. E.g. the key in the preferences.plist you mention is correct - it shows the same as in the System preferences.
    – Joe D
    Commented May 30, 2013 at 19:49
  • I have had the same issue today. What was the reason in your case? I am also freaked out a little, since I am afraid someone might have obtained an access to my mac
    – Ahmadov
    Commented Nov 10, 2017 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .