Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wide-Area Bonjour HOWTO?



Daniel Simon wrote:
i was very excited when i compiled the Bonjour prefpane in the latest
release and found "Wide-Area Bonjour."  i've been playing around with
mDNSProxyResponderPosix and ssh tunnels for quite some time trying to
effectively add remote computers to my local subnet . . . but the
prospect of doing this directly (with domain registering?) sounds
great.

the problem is: absolutely no documentation.  i've found a few leads
in this mailing list, but nothing that can get me (a 10.4 client user
with little sysadmin abibilities) from opening the prefpane (or
starting some daemon or other) to actually using wide-area bonjour.

so . . . is there anyone out there who could help?  how is this done?
is tiger server required?  do i need to run/download any daemons for
this to work?  is this actually usable, or am i just looking at a
non-functional "teaser" prefpane?  is there some missing
documentation i could download?

You don't need tiger (in fact, you even don't need a Mac), and you need to configure a DNS server. At least, to advertise static services.


OK, a quick howto. Sorry if not all bits and pieces are correct.
Credit goes to Stuart Cheshire for showing this at a lecture once.
Critics goes to me or /dev/null

Bonjours works using DNS. For local area bonjour, it uses a special kind of DNS services using multicast (mDNS). Wide area Bonjour, on the other hand, uses normal DNS servers.

Now, let's say start with something simple. Say, you want to your domain to advertise a website. Let's say my site is www.apple.com, and my domain is macfreek.nl (OK, that's not really _my_ site, and my name is not Steve, but that's why this is an example ;-) ).

To do this is an static way, you have to add a few records to your DNS server. First of all, you want to advertise a webserver. Now you need to know that the service type for a webserver is "_http._tcp". You can find these at http://www.dns-sd.org/ServiceTypes.html

Now what you do, is you make a so-called "SRV" (Service Record) in your DNS configuration, and you also need to add a "TXT" record:
Here is mine:
; service records
$ORIGIN macfreek.nl.
Apple._http._tcp IN SRV 10 100 80 www.apple.com.
Apple._http._tcp IN TXT "path=/"


The syntax for SRV records is:
Name._service._protocol  IN   SRV   priority  weight  port  target

Name is the human readable name of the service, and target is the location of the service. RFC 2782 describes the other parameters.
The TXT record is often optionally, but I think the current version of Apple's software (mDNSresponder) requires it. You can use the TXT record to give additional information about the service. In this case, it gives the path (you could change it to path=/quicktime/ if you want to point to http://www.apple.com/quicktime/).
Note that Name is human readable, and can even contain spaces. However, I haven't figured out how to do that yet.


Now this is pretty nice. You can even find about my service advertisement online (that is, if the DNS isn't cached, I just added the records for this short howto):

$ host -t ANY Apple._http._tcp.macfreek.nl.
Apple._http._tcp.macfreek.nl SRV 10 100 80 www.apple.com.
Apple._http._tcp.macfreek.nl text "path=/"

Now we're almost there. Bonjour still has to be told that there is a service advertisement. Unfortunately, there is no wildcard in DNS:
$ host -t ANY *._http._tcp.macfreek.nl.
does not work.


So you need to point to it from your domain, using a PTR record:

; service records
$ORIGIN _http._tcp macfreek.nl.
_http._tcp            IN   PTR   Apple._http._tcp.macfreek.nl.
Apple._http._tcp      IN   SRV   10    100   80    www.apple.com.
Apple._http._tcp      IN   TXT   "path=/"

Note that you can have multiple PTR records.

Again, you can query this on-line:
$ host -t ANY _http._tcp.macfreek.nl.
_http._tcp.macfreek.nl domain name pointer Apple._http._tcp.macfreek.nl.

(Note that you'll see some other records, please ignore them. They were from earlier experiments with SRV records).

As a side-note, DNS experts probably abbreviate this to:
; service records
$ORIGIN _http._tcp macfreek.nl.
@          IN   PTR   Apple._http._tcp.macfreek.nl.
Apple      IN   SRV   10    100   80    www.apple.com.
Apple      IN   TXT   "path=/"

Now that this is all set up, let's tell the Bonjour prefpane to look for records in the macfreek.nl domain:
Go to the Bonjour prefpane, and click the "Browsing" tab. Now click the "+" and add the domain "macfreek.nl". Click apple.


Now, open Safari, and go to "Show all bookmarks" (in the bookmarks menu). As you hopefully see, there is a record, named "Apple", which points to "http://www.apple.com./";. This is the one fetched from DNS.

Of course, in DNS you can also advertise other services than websites. For example, an Apple File Sharing Server, or a SubEthaEdit client, or a H.232 video phone.


Now, this was just a short example how to add static records in DNS to advertise your resources. However, what you probably want in the end is to also do that dynamically, if resources come and go.


I can imagine that the "Hostname" and "Registration" tabs in Bonjour do something like that, but I never checked that yet. I'm sure Kiren will tell us the details soon enough (I just noticed that there is a service type _dns-update._udp.<domain> registered by a familiar name).

Hopefully the Apple FAQ will be a bit more high-level, though I'm always interested in all the gorry (or brilliant) details.

Regards,
Freek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bonjour-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bonjour-dev/email@hidden

This email sent to email@hidden
References: 
 >Wide-Area Bonjour HOWTO? (From: "Daniel Simon" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.