From eb1005697e5b7a2eb296583c506c30953c08259f Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 11 Apr 2021 20:43:34 +0530 Subject: [PATCH] DnsServer: fixed bug in ProcessBlockedQuery() caused by missing else condition check which would cause the server to return Refused response when block zone is not empty and block list zone is empty. --- DnsServerCore/Dns/DnsServer.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/DnsServerCore/Dns/DnsServer.cs b/DnsServerCore/Dns/DnsServer.cs index 9338534e..1063c451 100644 --- a/DnsServerCore/Dns/DnsServer.cs +++ b/DnsServerCore/Dns/DnsServer.cs @@ -1499,12 +1499,19 @@ namespace DnsServerCore.Dns { //domain not blocked in blocked zone if (_blockListZoneManager.TotalZonesBlocked > 0) + { response = _blockListZoneManager.Query(request); //check in block list zone - if (response == null) - return null; //domain not blocked in block list zone + if (response == null) + return null; //domain not blocked in block list zone - //domain is blocked in block list zone + //domain is blocked in block list zone + } + else + { + //domain not blocked in block list zone + return null; + } } else {