This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Default number of dns retries doubled
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Ángel González <keisial at gmail dot com>
- Cc: libc-help <libc-help at sourceware dot org>
- Date: Fri, 16 Aug 2013 10:28:39 -0400
- Subject: Re: Default number of dns retries doubled
- References: <520E0F55 dot 6020500 at gmail dot com>
On Fri, Aug 16, 2013 at 7:39 AM, Ángel González <keisial@gmail.com> wrote:
> resolv.conf(5) contains:
>>
>> attempts:n
>> sets the number of times the resolver will send
>> a query to its name servers before giving up and returning an error to the
>> calling application. The
>> default is RES_DFLRETRY (currently 2, see
>> <resolv.h>). The value for this option is silently capped to 5.
>
>
> My /usr/include/resolv.h does indeed contain
>>
>> # define RES_DFLRETRY 2 /* Default #/tries. */
>
>
> /etc/resolv.conf only contains two nameserver lines.
>
> However, traffic sniffing shows 8 dns requests before giving up (4 to each
> nameserver).
>
> And a simple program confirms it:
>>
>> #include <resolv.h>
>>
>> int main() {
>> res_init();
>> printf("Timeout: %d\n", _res.retrans);
>> printf("Attempts: %d\n", _res.retry);
>> return 0;
>> }
>
>
> Output:
>>
>> Timeout: 5
>> Attempts: 4
>
>
> Any idea for this discrepancy?
A lot of reasons...
Is it issuing A and AAAA requests at the same time?
Are you requesting an FQDN and does the resolver have to go through
some redirection?
Cheers,
Carlos.