TechnitiumSoftware / DnsServer

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

System.NullReferenceException referencing DnsServer.cs:line 1917 and DnsServer.cs:line 1225 #1043

Closed natecoffey closed 1 month ago

natecoffey commented 1 month ago

This is a fairly new public primary DNS server for several zones and we've started to notice that approx every 30 sec we're getting a new logged event like below. The redacted IP is our upstream secondary DNS servers and I was thinking that there was a problem in the config somewhere referencing a null TSIG name, but thus far I have found nothing out of the ordinary. I have even backed up all settings and restored them, thinking that if there were invalid settings it may resolve them as a result.

Any help or insight would be greatly appreciated.

[2024-09-23 16:37:09 UTC] [xxx.xxx.xxx.xxx:43418] [TCP] System.NullReferenceException: Object reference not set to an instance of an object.
   at DnsServerCore.Dns.DnsServer.ProcessZoneTransferQueryAsync(DnsDatagram request, IPEndPoint remoteEP, DnsTransportProtocol protocol, String tsigAuthenticatedKeyName) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\DnsServer.cs:line 1917
   at DnsServerCore.Dns.DnsServer.ProcessQueryAsync(DnsDatagram request, IPEndPoint remoteEP, DnsTransportProtocol protocol, Boolean isRecursionAllowed, Boolean skipDnsAppAuthoritativeRequestHandlers, String tsigAuthenticatedKeyName) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\DnsServer.cs:line 1225
ShreyasZare commented 1 month ago

Thanks for reporting this issue. The error is coming due to a minor bug in writing the error log message and can be safely ignored.

Your DNS server is receiving a zone transfer request for a zone that does not exists on the server. The error being logged needs the zone name to write the error message and is using wrong variable (which is null) for it causing this exception instead that gets logged.

You can check if the secondary server has the correct IP for the primary server or check that the zone really exists so that this error would stop being logged.

Will get this fixed in the next update.

natecoffey commented 1 month ago

Great, thank you! After making this issue, I started to do some correlations between errors and other query log events and noticed that it did seem that there were a lot of zones that were failing AXFR and IXFR since we're mid-migration. We have several zones already, but many more to move over in the next couple weeks, so the secondaries are all already trying to do transfers apparently. I appreciate the insight!