Re: dns_lookup returns NULL?
Re: dns_lookup returns NULL?
- Subject: Re: dns_lookup returns NULL?
- From: Josh Graessley <email@hidden>
- Date: Tue, 11 Aug 2009 14:37:52 -0700
I believe the most common cause of this failure is a configd crash
(usually in one of the plug-ins). If configd crashes, other parts of
the system are unaware that they will no longer receive notification
of network changes. mDNSResponder loses DNS settings.
-josh
On Aug 11, 2009, at 2:32 PM, Marc Majka wrote:
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.
-- Marc
On 11 Aug, 2009, at 14:17, Mike Patnode wrote:
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.
mp
Date: Mon, 10 Aug 2009 15:25:55 -0700
From: Marc Majka <email@hidden>
Subject: Re: dns_lookup returns NULL?
To: appledev <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"
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.
--
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden