What is the difference between hostname , computername , localhostname

Joined
Mar 13, 2014
Messages
7
Reaction score
0
Points
1
Hi all ,

I want to know the difference between OS X "hostname , computername , localhostname" .


Which name can be used to ssh into the machine ?

Using which name I can ping the machine ?

Which name is used by DNS to resolve host ?

I would appreciate your assistance ...





Thanks ,
Gokul
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
Those should all be the same.
For ssh and ping and other DNS access, it depends on your DNS server. Do you have one on your local network, for instance? I don't have one on mine, so I can't use the machine's hostname to access it. I have to use IP address.

Maybe you need to explain the circumstances better?
 
OP
G
Joined
Mar 13, 2014
Messages
7
Reaction score
0
Points
1
Yes , I have one local DNS configured .

It is using Mac's ComputerName (i.e) name in the Sharing System preference pane .If it is so , what is the use of hostname & localhostname( sudo scutil --get HostName) ???

In my environment , I can ping & ssh a machine using Computer name but not with hostname .
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
OK, I think some DHCP servers give HostName if ComputerName isn't already set. I get "not set" for HostName, and "liberty" for LocalHostName.
I have a line in my /etc/hosts file like this:
127.0.0.1 localhost liberty
 
OP
G
Joined
Mar 13, 2014
Messages
7
Reaction score
0
Points
1
So, I assume like , one can ping or ssh a local machine using its computername .

Hostname of a mac machine is useless.???
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top