Skip to content

Commit

Permalink
Fixing retry conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaCo committed May 26, 2021
1 parent 7239fe4 commit 314f0a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DnsClient/LookupClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1564,9 +1564,13 @@ private IDnsQueryResponse ProcessResponseMessage(
{
handleError = HandleError.RetryNextServer;
}

// Try next server if the question isn't answered (ignoring ANY and AXFR queries)
else if (request.Question.QuestionType != QueryType.ANY
&& request.Question.QuestionType != QueryType.AXFR
&& !((request.Question.QuestionType == QueryType.A || request.Question.QuestionType == QueryType.AAAA)
&& result.Answers.OfRecordType(ResourceRecordType.CNAME).Any())
&& !(request.Question.QuestionType == QueryType.NS && result.Authorities.Any())
&& !result.Answers.OfRecordType((ResourceRecordType)request.Question.QuestionType).Any())
{
handleError = HandleError.RetryNextServer;
Expand Down

0 comments on commit 314f0a7

Please sign in to comment.