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: Using apple resolver libraries



> From: Justin Walker <email@hidden>
> Date: Mon, 10 May 2004 09:47:40 -0700
> To: Darwin Developer List <email@hidden>
> Subject: Re: Using apple resolver libraries
>
> On May 9, 2004, at 23:10, Andrew White wrote:
>
>> Apple uses a special resolver / DNS client selection routine, as
>> specified by resolver(5). Can someone point me at:
>>
>> (1) Source code. I have libinfo, but it's rather opaque to cursory
>> examination.
>
> Perhaps resolver isn't what you want. Name resolution (except for
> programs like 'nslookup' and 'dig') occurs in lookupd. That is where
> the action is. The resolver library calls used by most programs just
> hand off the request to lookupd, which does its 'strategy' thing.
>
> The "real" resolver code, along with that for "lookupd", lives in the
> netinfo project. I'm not sure where the resolver stub code lives.

This depends on what API calls applications are using. For gethostbyname,
getaddrinfo, etc, the calls use lookupd. For res_query, etc, the calls do
not use lookupd, and there is no caching. Look for darwin source for
Libinfo. Also, as Justin pointed out, nslookup and dig do not use these
libraries, so don't assume that because nslookup resolves names, that your
application should too.

>> (2) Documentation on how it works "inside".
>
> Nope; don't know of any, beyond the man pages (which are pretty good
> and getting better), folklore, and the archives. Start with 'man
> lookupd'.
>

Use tcpdump and look at the network traffic. Use lookupd -flushcache before
doing a trace.

>> (3) Diffs from FreeBSD, or wherever the original base code came from.
>
> Ha! The original code base is NeXTStep/OpenStep, and I don't know that
> the diffs would do you much good (if, indeed, they exist).
>

--
Paul W. Nelson
Thursby Software Systems, Inc.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Using apple resolver libraries (From: Justin Walker <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.