Closed jol64 closed 8 months ago
I have been investigating (one) parsing errors. Actually the record queried does exist, the NSEC3 is in the additional section and obviously does not have a type bitmap (none shown in WireShark). If I allow bitmap length 0 in NSec(3)Records, then this exception goes away. I don´t know whether length 0 is ok, but the DNS server returning that respose is Cloudflare 1.1.1.1
Thanks for looking into it. Yeah I think that makes sense to allow 0 here I'll try to change that in the next update
I am experiencing the following exceptions with version 1.7 running on .NET Framework 4.8:
Object reference not set to an instance of an object. at DnsClient.LookupClient.HandleDnsResponeParseException(DnsResponseParseException ex, DnsRequestMessage request, DnsMessageHandleType handleType, Boolean isLastServer) at DnsClient.LookupClient.ResolveQuery(IReadOnlyList
1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit) at DnsClient.LookupClient.QueryInternal(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection
1 servers) at DnsClient.LookupClient.Query(DnsQuestion question) at DnsClient.LookupClient.Query(String query, QueryType queryType, QueryClass queryClass) at SmtpSecAnalyzer.MailExchangeAnalysis.DnsQuery[T](LookupClient lc, QueryType q, String name, MailDnsInfo parent)I am getting this for a TXT and a TLSA record lookup where the queried records do not exist, and the zone is signed (supporting DNSSEC). Looking at the code I suspect the resonse is too big to fit within a typical package (contains SOA, 3NSEC3, 4RRSIG).
In fact, when I provide something along LookupClientOptions (nameserveraddresses) {UseTcpOnly = true} I get a different exception:
invalid bitmap length, less than 2 bytes available. at DnsClient.Protocol.NSecRecord.d11.MoveNext()
at System.Linq.Bufferd 1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator
1..ctor(IEnumerable
1 source) at System.Linq.OrderedEnumerable`1.2.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) at DnsClient.Protocol.NSec3Record..ctor(ResourceRecordInfo info, Byte hashAlgorithm, Byte flags, Int32 iterations, Byte[] salt, Byte[] nextOwnersName, Byte[] bitmap) at DnsClient.DnsRecordFactory.ResolveNSec3Record(ResourceRecordInfo info) at DnsClient.DnsRecordFactory.GetRecord(ResourceRecordInfo info) at DnsClient.DnsMessageHandler.GetResponseMessage(ArraySegment`1 responseData)which doesn´t help either.
As a work around I am assuming a record does not exist when I encounter an exception, but I´d prefer a standard NX-Response.