> Eric Wing wrote:
> > From the documentation, I'm under the impression that
> > I should call gethostbyname(hosttarget); to ultimately
> > figure out the IP address to use. First, is this the
> > correct way to do things?
>
> From what you've said, I think so.
>
> > If so, I'm having problems with the correct name
> > resolution returned by gethostbyname(). The ".local."
> > in the hosttarget string is causing the call to fail.
> > I noticed that in Linux, a libnss_mdns-0.2.so is
> > created, /etc/nsswitch.conf is modified, and
> > /etc/nss_mdns.conf is created.
> >
> > I seem to be missing this library and support files
> > when I try installing on FreeBSD and Solaris. What do
> > I need to do to allow gethostbyname() to handle the
> > .local. qualifier correctly?
Having gethostbyname() understand dot-local names is nice
for compatibility with non-mDNS-aware legacy applications
(ie your web browser) but in my understanding it is not
strictly necessary for mDNS-aware code.
You should be able to retreive the host's A record through mDNS
using (I think) DNSServiceQueryRecord. That would be basically
doing in your code what libnss_mdns does.
Of course, nothing prevents a local-subnet machine from advertising
a service that resides on a non-local host. For these names you
must still use gethostbyname() as they are only resolvable through
unicast DNS.
Usable as a short-term solution (easier than grokking the internals
of the BSD/Solaris resolvers), and perhaps even on a longer term
if you want your app to be installable by non-root users.
Hope this helps,
--Jonathan
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.