TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.47k stars 431 forks source link

DnsClient recursive resolution exceeded the maximum stack count #271

Closed necrogami closed 3 years ago

necrogami commented 3 years ago

[2021-06-22 18:29:00 UTC] DNS Server recursive resolution failed for QNAME: blinkstick.com; QTYPE: A; QCLASS: IN; TechnitiumLibrary.Net.Dns.DnsClientException: DnsClient recursive resolution exceeded the maximum stack count for domain: blinkstick.com at TechnitiumLibrary.Net.Dns.DnsClient.RecursiveResolveAsync(DnsQuestionRecord question, IDnsCache cache, NetProxy proxy, Boolean preferIPv6, Boolean randomizeName, Boolean qnameMinimization, Int32 retries, Int32 timeout, Int32 maxStackCount) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Dns\DnsClient.cs:line 368 at DnsServerCore.Dns.DnsServer.RecursiveResolveAsync(DnsDatagram request, IReadOnlyList1 viaForwarders, Boolean cachePrefetchOperation, Boolean cacheRefreshOperation, TaskCompletionSource1 taskCompletionSource) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\DnsServer.cs:line 1993

Any idea why i'm getting this? I'm using the root for recursion not through any public recursing server

ShreyasZare commented 3 years ago

Thanks for reporting this. I tried to resolve the domain at my end and sometimes its resolving well while sometimes giving the error you posted. So, I ran wireshark and tried it again. It seems that the domain name's DNS provider 1and1 has badly configured their name servers causing resolution loops. It depends on which name server is chosen randomly by the DNS server. For some selected name servers in the worst case scenario, resolving their IP address goes into loop which hits the limit on number of hops that can be taken.

The following is the screenshot when it gives the error. See how the name server resolution is heading from one to another to yet another back to the first. image

This is another screenshot where the DNS server managed to resolve the domain name finally just before hitting the max hop limit.

image

However, once the name server's IP address is resolved and cached, the domain name is resolving well. And when the NS records expire after 2 days, this error may come up again until the NS records are resolved again and cached.

ShreyasZare commented 3 years ago

New update v6.4 is now available which fixes this issue by increasing the max stack count limit.