TechnitiumSoftware / DnsServer

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

Exception while blocking domain using Advanced Blocking #800

Closed marcoaddario closed 11 months ago

marcoaddario commented 11 months ago

Technitium 11.5.3 with Advanced blocking 6.1

I am trying to configure the advanced blocking for a domain for a specific host but the dns server raised an exception:

[2023-12-05 14:46:08 UTC] [192.168.1.120:62838] [marco] DNS application 'Advanced Blocking' app config was saved successfully.
[2023-12-05 14:46:23 UTC] [192.168.1.81:35382] [UDP] System.NullReferenceException: Object reference not set to an instance of an object.
   at AdvancedBlocking.App.ProcessRequestAsync(DnsDatagram request, IPEndPoint remoteEP) in Z:\Technitium\Projects\DnsServer\Apps\AdvancedBlockingApp\App.cs:line 582
   at DnsServerCore.Dns.DnsServer.ProcessBlockedQueryAsync(DnsDatagram request, IPEndPoint remoteEP, DnsTransportProtocol protocol) in Z:\Technitium\Projects\DnsServer\DnsServerCore\Dns\DnsServer.cs:line 2669

this is the part of the config file with the group config:

 {
      "name": "kids",
      "enableBlocking": true,
      "allowTxtBlockingReport": true,
      "blockAsNxDomain": true,
      "blockingAddresses": [
        "0.0.0.0",
        "::"
      ],
      "allowed": [],
      "blocked": [
      "example.com"
      ],
      "allowListUrls": [],
      "blockListUrls": [
        "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts"
      ],
      "allowedRegex": [],
      "blockedRegex": [],
      "regexAllowListUrls": [],
      "regexBlockListUrls": [],
      "adblockListUrls": []
    }

The blocking for the domains in the blockListUrls section works, so the networkGroupMap should be configured correctly

ShreyasZare commented 11 months ago

Thanks for reporting this. However, I would need to have the exact config to be able to reproduce this bug. Do share the config you have over here or send it to support@technitium.com if you do not wish to disclose it publicly.

ShreyasZare commented 11 months ago

I did some tests and found the exact issue. Will release a fix soon.

ShreyasZare commented 11 months ago

Advanced Blocking App v6.1.1 is now available that should fix this issue. Do update the app and let me know your feedback.

marcoaddario commented 11 months ago

Thanks a lot! The release has fixed the issue.

ShreyasZare commented 11 months ago

Thanks for the feedback.