admin管理员组

文章数量:1355675

How are DNS query retries controlled using Simple Resolver in DNSJava? Using the same resolver, we see retries of 2 and in some cases 3. It is not clear as to how it is retried. Any help in this regard?

Update - The attempts are consistent on different machines with the same piece of code.

    SimpleResolver           resolver = (dns == null) ? new SimpleResolver() : new 
    SimpleResolver(dns) ;

    resolver.setTimeout(Duration.ofMillis(dnsTimeoutMs));
    lookup.setResolver(resolver) ;
    lookup.setCache(null);

    .xbill.DNS.Record[]   records = lookup.run() ;

How are DNS query retries controlled using Simple Resolver in DNSJava? Using the same resolver, we see retries of 2 and in some cases 3. It is not clear as to how it is retried. Any help in this regard?

Update - The attempts are consistent on different machines with the same piece of code.

    SimpleResolver           resolver = (dns == null) ? new SimpleResolver() : new 
    SimpleResolver(dns) ;

    resolver.setTimeout(Duration.ofMillis(dnsTimeoutMs));
    lookup.setResolver(resolver) ;
    lookup.setCache(null);

    .xbill.DNS.Record[]   records = lookup.run() ;

Share Improve this question edited Mar 31 at 5:43 pradeep asked Mar 28 at 6:50 pradeeppradeep 451 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Neither the SimpleResolver nor Lookup perform retries, only the ExtendedResolver does that. The only time a query is sent again by the SimpleResolver is when the initial UDP query failed and the fallback to TCP is attempted.

If you attach a logger, e.g. slf4j-simple, and raise the log level to DEBUG, you should see detailed information what's going on.

本文标签: timeoutdnsjavaHow are DNS query retries controlled using Simple Resolver in DNSJavaStack Overflow