Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X 10.7 Lion

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 9, 2011, 03:10 AM   #1
Akarin
macrumors 6502
 
Join Date: Oct 2011
Location: Nyon, Switzerland
Question terminal not showing machine's name. Why?

Hi all,

When I open terminal, I see this:



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!
__________________
Teach yourself how to code with Swift: Code with Brick
Akarin is offline   0 Reply With Quote
Old Nov 9, 2011, 03:26 AM   #2
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Have you looked at what the "Computer Name" is set to in "Sharing" preferences?

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Nov 9, 2011, 04:05 AM   #3
Akarin
Thread Starter
macrumors 6502
 
Join Date: Oct 2011
Location: Nyon, Switzerland
Quote:
Originally Posted by sidewinder View Post
Have you looked at what the "Computer Name" is set to in "Sharing" preferences?

S-
Yes... It's set on "MyName's Mac mini".
__________________
Teach yourself how to code with Swift: Code with Brick
Akarin is offline   0 Reply With Quote
Old Nov 9, 2011, 06:03 AM   #4
Quad5Ny
macrumors 6502a
 
Join Date: Sep 2009
Does the "hostname" and "whoami" command list the correct info?

Try quitting Terminal completely and then logging on/off of your account.
Quad5Ny is offline   0 Reply With Quote
Old Nov 9, 2011, 11:03 AM   #5
Akarin
Thread Starter
macrumors 6502
 
Join Date: Oct 2011
Location: Nyon, Switzerland
Quote:
Originally Posted by Quad5Ny View Post
Does the "hostname" and "whoami" command list the correct info?

Try quitting Terminal completely and then logging on/off of your account.
This is what I get with those two commands, after logging off and back on:

__________________
Teach yourself how to code with Swift: Code with Brick
Akarin is offline   0 Reply With Quote
Old Nov 9, 2011, 01:44 PM   #6
Macopotamus
macrumors regular
 
Join Date: Jun 2010
Quote:
Originally Posted by Akarin View Post
This is what I get with those two commands, after logging off and back on:

Image
Try setting the hostname again with "sudo hostname -s MacName"
__________________
Sites I read: http://macrumors.com - http://9to5mac.com - http://osxdaily.com
Macopotamus is offline   0 Reply With Quote
Old Nov 9, 2011, 06:20 PM   #7
yawns
macrumors member
 
Join Date: Oct 2011
sudo scutil --set HostName NAMEYOUWANT.local

sudo hostname doesn't save between reboots.
__________________
I like that the email automatically says, "Sent from a MacBook Wheel." That way people know you have one.
yawns is offline   0 Reply With Quote
Old Nov 11, 2011, 01:39 AM   #8
Akarin
Thread Starter
macrumors 6502
 
Join Date: Oct 2011
Location: Nyon, Switzerland
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.
__________________
Teach yourself how to code with Swift: Code with Brick
Akarin is offline   0 Reply With Quote
Old Nov 11, 2011, 01:56 AM   #9
Phil A.
macrumors 68040
 
Phil A.'s Avatar
 
Join Date: Apr 2006
Location: Telford, UK
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.
__________________
Tell a man there are 300 billion stars in the universe and he'll believe you. Tell him a bench has wet paint on it and he'll have to touch it to be sure. ~Murphy's Law

Last edited by Phil A.; Nov 11, 2011 at 01:56 AM.
Phil A. is offline   0 Reply With Quote
Old Nov 11, 2011, 05:57 AM   #10
Akarin
Thread Starter
macrumors 6502
 
Join Date: Oct 2011
Location: Nyon, Switzerland
Quote:
Originally Posted by Phil A. View Post
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...
__________________
Teach yourself how to code with Swift: Code with Brick
Akarin is offline   0 Reply With Quote
Old Nov 28, 2011, 12:19 AM   #11
Grimace
macrumors 68040
 
Grimace's Avatar
 
Join Date: Feb 2003
Location: with Hamburglar.
I think Lion changed the name from something you name it to your MAC address. Check your Network settings and it probably matches up.
__________________
Canon 1DX Canon 5D MkIII
24-70mm f/2.8L II 70-200mm f/2.8L IS II
50mm f/1.2L 85mm f/1.2L II 300mm f/2.8L IS
Grimace is offline   0 Reply With Quote
Old May 2, 2012, 09:14 PM   #12
shamalk
macrumors newbie
 
Join Date: Mar 2012
Smile 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.
shamalk is offline   0 Reply With Quote
Old May 3, 2012, 01:23 AM   #13
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
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-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   1 Reply With Quote
Old May 31, 2014, 08:22 PM   #14
nodnami
macrumors newbie
 
Join Date: May 2014
Quote:
Originally Posted by sidewinder View Post
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.
nodnami is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X 10.7 Lion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Recovery HD not showing up - time machine restore clairej Mac Basics and Help 1 Mar 10, 2013 01:48 AM
Mail not showing images after restore from time machine dpo OS X 10.8 Mountain Lion 0 Feb 21, 2013 11:57 AM
NFS files not showing in Finder, although ls shows in terminal mirni Mac OS X 10.7 Lion 1 Nov 22, 2012 02:19 PM
AirPlay speakers not showing up on new Windows machine stickers11 Mac Peripherals 1 Nov 16, 2012 03:17 PM
Macbook Pro 2011 showing computer name as "ipad" in Terminal. St3b Mac OS X 10.7 Lion 3 Jun 19, 2012 04:07 PM

Forum Jump

All times are GMT -5. The time now is 04:18 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC