You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Computer Name versus hostname

I set my computer name by going to System Preferences > Sharing. In the Computer Name field, I enter the name I choose. Immediately below this field, there is a little comment that says this:

"Other computers on your local subnet can reach your computer at <name>.local"

where <name> is the name I entered in the Computer Name field.

However, when I open a Terminal session and I enter the 'hostname' command, it returns the following:

<name>.home

Notice it isn't <name>.local as I might have expected.

Three questions for those of you who are knowledgeable in this area:

1. Any idea why the hostname is <name>.home but the computer is accessible on the subnet as <name>.local?

2. Where is the hostname "<name>.home" set up by the OS (that is, in which file does the OS find this name upon boot up)?

3. What is the file where the computer name "<name>.local" is stored?

I suppose where all of this is headed, in case you know the answer to that also, is how to set the hostname so it is accessible on a network without either of these .local or .home suffixes.

Thanks for your help.

PowerMac G5, Mac OS X (10.3.x), Also applies to 10.5

Posted on Dec 4, 2007 8:40 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 4, 2007 9:41 PM

The hostname and computername are in /Library/preferences/SystemConfiguration/preferences.plist Plist files are easiest read with Property List Editor in /Developer/Applications/Utilities, assuming you loaded the developer software. In the preferences.plist file, you find these in Root>System>Network>HostNames>LocalHostName and
Root>System>System>ComputerName

However, the suffixes are not part of these entries. I have
LocalHostName = Franks-G3-iMac
ComputerName = Frank's G3 iMac

When I run "hostname" or "set" in terminal, I get Franks-G3-iMac.local (not with a .home suffix)

My wife's G5 iMac also has the .local suffix with "hostname" or "set" in terminal. (Both of us use the bash shell; I have no idea if that makes any difference.)

I hope these comments help

Frank
5 replies
Question marked as Top-ranking reply

Dec 4, 2007 9:41 PM in response to 1s&amp;0s

The hostname and computername are in /Library/preferences/SystemConfiguration/preferences.plist Plist files are easiest read with Property List Editor in /Developer/Applications/Utilities, assuming you loaded the developer software. In the preferences.plist file, you find these in Root>System>Network>HostNames>LocalHostName and
Root>System>System>ComputerName

However, the suffixes are not part of these entries. I have
LocalHostName = Franks-G3-iMac
ComputerName = Frank's G3 iMac

When I run "hostname" or "set" in terminal, I get Franks-G3-iMac.local (not with a .home suffix)

My wife's G5 iMac also has the .local suffix with "hostname" or "set" in terminal. (Both of us use the bash shell; I have no idea if that makes any difference.)

I hope these comments help

Frank

Dec 5, 2007 11:30 PM in response to Frank Henyey

Thanks for the info.

I use the same shell you do and I get <hostname>.home from both the 'set' or 'hostname' commands. "echo $HOSTNAME" does the same thing.

What's curious is, I have a MacBook with OS 10.5.1 on it, and it follows this same convention (.home instead of .local, even though System Preferences > Sharing says the Computer Name has .local as an appendage).

I recently installed 10.5 on a separate drive on my PowerMac (but this is not what I'm currently booting from; I'm booting from 10.3.9). Perhaps this is something that the 10.5 install has caused.

I'm still curious to know how the OS is setting my HOSTNAME variable.

dan

Dec 6, 2007 5:08 PM in response to 1s&amp;0s

Dan,

I checked a bit more -- My computer at work has similar entries in preferences.plist as my home computers. However, the Unix Hostname is completely different! It must be the network that assigns the name. At home I have a router, while at work, the computer support people maintain the network -- that must be the difference. At work, if I go to Network & look for my computer, I see the Unix Hostname, but if someone else looks for me on their computer, they see the Computer Name I assigned (this is Mac sharing, not windows sharing). Have you checked which name shows up on another computer? Have you tried setting the Hostname in Unix?

Frank

Dec 21, 2007 10:53 PM in response to Frank Henyey

Hi Frank,

I can see my machines on my home network (through the Mac OS Finder) without any suffixes to the hostnames of each machine. So the operating system seems to be able to sort through these different variations of the hostname.

This is all rather strange to me, as I have a fair amount of UNIX experience. On a typical UNIX box, the HOSTNAME variable is what the machine transmits and responds to on the network. So when I go into the Mac terminal bash shell and say 'echo $HOSTNAME' and I see <hostname>.home, but that isn't how the machine is seen by others on the network, this is odd.

The other thing that's strange is why the Preferences > Sharing > Computer Name field insists the machine is accessible on the network as <hostname>.local, as opposed to <hostname>.home (as is stored in the HOSTNAME system variable), or simply <hostname> (as appears in the Finder of other machines on the network). For someone coming from the typical UNIX/Linux world, these discrepancies are a bit baffling.

Anyway, thanks for the feedback.

dan

Computer Name versus hostname

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.