Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Akarin

macrumors 6502
Original poster
Oct 16, 2011
290
17
Nyon, Switzerland
Hi all,

When I open terminal, I see this:

terminal.png


Before I used to have "myname's Mac mini:" on the prompt. Now, I always have this "unknown..." line. Anybody knows why and how to fix it?

Thank you!
 
Does the "hostname" and "whoami" command list the correct info?

Try quitting Terminal completely and then logging on/off of your account.
 
sudo scutil --set HostName NAMEYOUWANT.local

sudo hostname doesn't save between reboots.
 
I tried both commands above and none of them work. My terminal just enters a mode with a prompt showing this:

>

...and nothing else. Then no command works and I have to quit & re-launch terminal before arriving to the same view as in the original post above. :confused:
 
Wirelessly posted (iPhone 4: Mozilla/5.0 (Linux; U; Android 2.3.3; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1)

Try setting your DHCP client ID to your machine name in network settings and then Renee your DHCP lease.
I've seen this before when a DHCP server updates the DNS server with unknown and the MAC address which then gets used as the hostname.
 
Wirelessly posted (iPhone 4: Mozilla/5.0 (Linux; U; Android 2.3.3; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1)

Try setting your DHCP client ID to your machine name in network settings and then Renee your DHCP lease.
I've seen this before when a DHCP server updates the DNS server with unknown and the MAC address which then gets used as the hostname.

Although the client ID was blank and I did what you propose, still no joy. Still having the unknown string in terminal...
 
Are you using Ethernet ?

Hi,
I have this problem when I connect my mac book air to Ethernet using the Ethernet to USB adapter.

When I remove Ethernet I get my normal hostname back.

Hope this helps.
 
The problem isn't your computer. Phil A. is right. The problem is that is the name you DHCP server is handing you.

Edit your account's ".bash_profile" file and add this to it:

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

The ".bash_profile" file should be at the root level of your user account. If it is not there, create it.

Now, if you put "8.8.8.8" at the top of your DNS list, I bet your hostname would work fine too.

S-
 
The problem isn't your computer. Phil A. is right. The problem is that is the name you DHCP server is handing you.

Edit your account's ".bash_profile" file and add this to it:

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

The ".bash_profile" file should be at the root level of your user account. If it is not there, create it.

Now, if you put "8.8.8.8" at the top of your DNS list, I bet your hostname would work fine too.

S-

I had the same problem and this worked for me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.