site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com -- Marc On 11 Aug, 2009, at 14:17, Mike Patnode wrote: mp Date: Mon, 10 Aug 2009 15:25:55 -0700 From: Marc Majka <majka@apple.com> Subject: Re: dns_lookup returns NULL? To: appledev <appledev@centrify.com> Cc: darwin-dev@lists.apple.com Message-ID: <EB755AEA-2B4B-4D95-B453-4E538C1E6EC2@apple.com> Content-Type: text/plain; charset="us-ascii" -- Marc Majka On 10 Aug, 2009, at 14:37, Mike Patnode wrote: Is there anyway to get error information when dns_lookup() returns NULL? It looks like the error code is supposed to be returned in the dns_reply_t structure. What does it mean when the return value is NULL? thx mp _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/majka%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/majka%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On 10.6, DNS queries are sent to mDNSResponder rather than to DirectoryService as they were on 10.5. If you can reproduce the problem, you may be able to collect some useful debugging output from mDNSResponder. See the mDNSResponder man page for info on getting debug log info. If you can get some data, please file a bug report. You are correct: dig, nslookup, and host all use bare-bones network routines from BIND. The follow a very different code path than mDNSResponder. I'll buy that. Any idea why on 10.6 it would suddenly start returning NULL for all lookups and continue to do so until a reboot? Tried restarting DS as well to no avail but a reboot seems to solve the problem once the system gets in that state. Where should I start looking for debug info? Note that dig and nslookup work fine, but I suspect they don't use this API. The "status" field of the dns_reply_t structure is currently unused (it's always zero). There's really not a lot of useful error information that could be returned by this level of API. dns_lookup() may do multiple queries to multiple DNS clients (see the resolver(5) man page). If none of the resolvers returned useful data for the query, dns_lookup() returns NULL. A failure like NXDomain from a particular nameserver really doesn't mean much if dns_lookup() is searching multiple sources. The situation is similar to an API like, say, getpwnam(). The DirectoryService daemon might search many different information sources to answer a getpwnam() query. If it finds data, it returns it. It really doesn't mean a lot if, as part of it's search, it got an error from an LDAP or NIS server, or if it checked /etc/passwd and failed to find a particular user. A reply is really a composite of all of the sub-searchs performed to answer a query. A NULL reply means they all "failed" in some way, but the API abstracts away the return codes for the various sub-systems. This email sent to majka@apple.com This email sent to majka@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Marc Majka