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: DNSServiceQueryRecord



> Ah, now I see what the problem is.
> 
> What you wnat to do is get the IP address for the
given host. In DNS 
> terms, this corresponds to looking up the "A"
record, where the left 
> hand side is the hostname and the right hand side is
the IP address.
> 
> But the query you're doing is not for the host, it's
for the service 
> record (Mytest._http._tcp.local,
macbox._afpovertcp._tcp.local, etc.).
>
> The query you should be doing is just for the
hostname plus domain, > e.g.
> 
> ./dns-sd -Q "macbox.local"

Thank you. This was indeed the problem. Marc actually
spotted this too yesterday, but I forgot it was off
list. But this helped clear up some of the terminology
for me.

But I'm confused on the documentation now. I posed
this question to Marc too (but probably should have
posted it here).

The API documentation says
QueryRecord wants a fullname where:

fullname
Pointer to the full name of the resource record. Call
DNSServiceConstructFullName to construct the full name
from a service name, a registration type, and a domain
name.

I thought the fullname returned by ResolveReply was
what I wanted, but it looks like I needed hostname.
And I thought DNSServiceContructFullName returned the
same string as the fullname I was using.

Is this a bug in the documentation, or am I
misinterpreting the terminology?
(I using the documentation from:
http://developer.apple.com/documentation/Networking/Conceptual/dns_discovery_api/index.htm
which seems to be same as the documentation in my
Xcode 1.5 beta seed).

And what is the implication for the other functions
that claim to use "fullname"? (i.e. 
DNSServiceRegisterRecord
DNSServiceReconfirmRecord

Do these need the fullname or the hosttarget?

Also, one other question that I've been wondering
about. Is there an elegent way for handling IPv4 and
IPv6 using the Query call? It seems that I have to
know before hand since I have to specify the rrtype.
If I look for the wrong type, my program seems to
block indefinitely. I could query for both, but I
presume most likely, one of them will hang. I could
force a timeout with select, but I'm not sure how long
it should be. If it's too long, the user will
experience a noticable delay, especially since it was
likely that I wouldn't try to resolve until the user
requested it and they are now waiting explicitly for
me to connect them.

Thanks again,
Eric
_______________________________________________
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.




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.