RE: Obtaining local host name
RE: Obtaining local host name
- Subject: RE: Obtaining local host name
- From: Kenny Millar <email@hidden>
- Date: Tue, 24 Nov 2009 11:13:33 +0000
For what it's worth, here is a strange but related issue that you might like
to be aware of.
My Mac is imaginatively named 'devMac' and lives on the corporate network at
work. It gets it's IP address and gateway settings etc etc from the
corporate DHCP server.
In system preferences, under 'sharing' the computer name is set to "devMac"
and the text says "Computers on your local network can access your computer
at: macDev.local"
However, and this is the strange bit. If I open a terminal session, the
prompt, which should contain the computer name, reads "BobsDellLaptop:~
kenny$" (this name is subject to change from time to time!)
This means that the terminal session (or whatever) has done a reverse lookup
of it's own IP address and got the wrong name back from our corporate DNS
system. I guess this is a fault with the DNS server or something similar,
but still, it shows that somewhere under the hood of Mac OS X it does not
use the user-supplied information, but rather tries to figure it out for
itself.
-Kenny.
-----Original Message-----
From: macnetworkprog-bounces+kennymillar=email@hidden
[mailto:macnetworkprog-bounces+kennymillar=email@hidden] On
Behalf Of Peter Sichel
Sent: 24 November 2009 10:03
To: MacNetworkProg Mac Network
Subject: Re: Obtaining local host name
On Nov 23, 2009, at 4:41 AM, Quinn wrote:
> At 14:31 -0500 22/11/09, Peter Sichel wrote:
>> What confused me is that the LocalHostName may not exist (be null) until
you advertise a service, but the default name for your service will use the
computer name. The statement in Sharing Preferences that other hosts on
your LAN can access this computer using the LocalHostName is not true in the
default case of publishing your own service.
>
> I don't understand this comment. What test are you running and what is
going wrong?
My program Phone Amego has a Caller ID sharing feature that allows a copy of
the program running on one host to subscribe to another. When you turn on
"Caller ID Sharing" the program advertises a service. When you browse for
services from another Phone Amego, the service appears with the
corresponding "Computer Name."
When the user selects a service and presses "Subscribe", the local instance
sends a subscribe request to the remote service that includes the
LocalHostName. The remote service then adds this LocalHostName to its
publish list. Notice it does not browse for the service name, but receives
it in a subscribe request from the client.
This is a bug if the LocalHostName is not the same as the Computer Name.
The publish will fail to resolve the corresponding NSNetService. The
Sharing Preferences panel says other hosts on your LAN can access this
computer using the LocalHostName, but that's not true in the default case of
advertising your own service, you must use the local Computer Name or it
won't work.
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden