• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get the local Bonjour name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to get the local Bonjour name? (From: Dave Camp <email@hidden>)

  • Prev by Date: How to get the local Bonjour name?
  • Next by Date: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
  • Previous by thread: How to get the local Bonjour name?
  • Next by thread: Why might CFReadStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle) return NULL?
  • Index(es):
    • Date
    • Thread