Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Access Bonjour discovery info from the command line UNIX
It took me a little while to find this, so I thought I'd share. You can access BonJour (nee Rendezvous) discovery services from the command line by using the command dns-sd in 10.4, or mDNS in 10.3. There doesn't appear to be a man page for mDNS in 10.3, but it appears that the options for dns-sd, favored in 10.4, work just the same for either command (and in fact the man page for mDNS is present in 10.4).

For example, to view all of the ssh shares on Bonjour-enabled computers, try this in the Terminal (replace dns-sd with mDNS if you're on 10.3):
dns-sd -B _ssh._tcp .
You should receive a list of workstations that are broadcasting ssh services via Bonjour. Don't forget that you need to replace the spaces with hyphens and add a .local prefix when trying to connect. For example, to ssh to Macintosh HD found this way, you need to use ssh Macintosh-HD.local. To view AFP shares (maybe AppleTalk isn't turned on?), try this one:
dns-sd -B _afpovertcp._tcp .
This page lists more of the potential services you might be able to find. And, as always, you can read the man pages for more help (in 10.4, at least) -- man dns-sd has a few pages of content.
    •    
  • Currently 3.25 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[44,907 views]  

Access Bonjour discovery info from the command line | 3 comments | Create New Account
Click here to return to the 'Access Bonjour discovery info from the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Access Bonjour discovery info from the command line
Authored by: ework on Oct 31, '05 09:28:45AM

Now this is a really cool hint!



[ Reply to This | # ]
Access Bonjour discovery info from the command line
Authored by: Greedo on Oct 31, '05 10:59:56AM
You can also look at the file /etc/services file for the list of services that might be available. Just add the underscore character and add ._tcp or ._udp to the end.

[ Reply to This | # ]
Access Bonjour discovery info from the command line
Authored by: Raven on Nov 03, '05 06:33:01AM

Very interesting indeed. However, I'm not quite sure about the syntax to use to only check one machine for lets say the afp service availability... Its just that if I do a general search like proposed here, I'm looking at getting over 200 results...



[ Reply to This | # ]