Re: How to get the local Bonjour name?
Re: How to get the local Bonjour name?
- Subject: Re: How to get the local Bonjour name?
- From: Marc Krochmal <email@hidden>
- Date: Thu, 28 Aug 2008 21:48:05 -0700
Hi Dave,
On Aug 28, 2008, at 4:35 PM, Dave Camp wrote:
I seem to be failing to figure out how to do this. I want to get the
Bonjour name of the local machine to display in some UI (e.g. my-
fancy-mac.local), but I can't seem to find an API for this. I can
find how to publish services and browse them, but not how to just
get the local machine name.
Can someone point me in the right direction?
There's really no such thing as the "Bonjour name", since Bonjour
typically uses two different names. It assigns a Local Hostname (also
called the dot-local name) to each machine, and it advertises services
using the Computer Name. You can use SCDynamicStoreCopyLocalHostName
to return the "my-fancy-mac" part of the Local Hostname, and you can
use SCDynamicStoreCopyComputerName to get the Computer Name. Most of
the time you shouldn't be showing the Local Hostname to the user. The
Computer Name should be used for that purpose.
-Marc
_______________________________________________
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