timeout - dnsjava - How are DNS query retries controlled using Simple Resolver in DNSJava? - Stack Overflow

How are DNS query retries controlled using Simple Resolver in DNSJava? Using the same resolver, we see

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744052041a4550252.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信