Skip to content

Commit 314f0a7

Browse files
committed
Fixing retry conditions
1 parent 7239fe4 commit 314f0a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DnsClient/LookupClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,9 +1564,13 @@ private IDnsQueryResponse ProcessResponseMessage(
15641564
{
15651565
handleError = HandleError.RetryNextServer;
15661566
}
1567+
15671568
// Try next server if the question isn't answered (ignoring ANY and AXFR queries)
15681569
else if (request.Question.QuestionType != QueryType.ANY
15691570
&& request.Question.QuestionType != QueryType.AXFR
1571+
&& !((request.Question.QuestionType == QueryType.A || request.Question.QuestionType == QueryType.AAAA)
1572+
&& result.Answers.OfRecordType(ResourceRecordType.CNAME).Any())
1573+
&& !(request.Question.QuestionType == QueryType.NS && result.Authorities.Any())
15701574
&& !result.Answers.OfRecordType((ResourceRecordType)request.Question.QuestionType).Any())
15711575
{
15721576
handleError = HandleError.RetryNextServer;

0 commit comments

Comments
 (0)