libreoslv API quesiton: Using RES_SECV and RES_STAYOPEN with TCP

Stefan Puiu stefan.puiu at gmail.com
Sat Apr 14 11:16:52 UTC 2007


Hi Shiva,

The Linux resolver.3 manual page says:

       RES_PRIMARY
              Query primary domain name server only.

It could be that "primary domain name server" is the MNAME from the
SOA returned for the domain. However, the Linux manpage is *very*
outdated wrt to the actual resolver code. The resolver.3 manual page
from bind-8.4.7 doesn't mention the option, it could be that it was
removed.

I've never used the option, so I can't say. The same goes for
RES_STAYOPEN. The behaviour you are expecting (that the socket should
stay open) is the one documented in the manual.

As for always continuing to use a nameserver, I agree with Kevin that
using a local caching-only nameserver looks like a better idea.

Stefan.

On 4/14/07, Balasubramanyam, Shivakumar <sbalasub at qualcomm.com> wrote:
> Hi,
>
> I have a problem using the client libresolv api for the scenarion below.
>
>
> I have two nameservers A and B in that order in /etc/resolv.conf and
> issues are being found if named is not running in machine nameserver A.
>
> Using UDP:
> 1. The queries always go to nameserver A, fails and then succeeds with
> B. How do you specify to API to continue with B as long as queries are
> successful?
>
> 2. What does _res option RES_PRIMARY mean?
>
>
> Using TCP:
> 1.   Same question,  How do you specify to API to continue with B as
> long as queries are successful?
> 2. How does RES_STAYOPEN work? In my case, even after setting this
> option, socket is getting closed after a single attempt.
>
>
> I would greatly appreciate for any ides on this one. Currently I am
> thinking of using the c-ares api to verify the behavior.
>
> Thanks,
> Shiva
>
>
>



More information about the bind-users mailing list