diff --git a/DnsServerCore/Dns/DnsServer.cs b/DnsServerCore/Dns/DnsServer.cs index 2bef4f66..0ab8000f 100644 --- a/DnsServerCore/Dns/DnsServer.cs +++ b/DnsServerCore/Dns/DnsServer.cs @@ -131,6 +131,7 @@ namespace DnsServerCore.Dns int _cachePrefetchTrigger = 9; int _cachePrefetchSampleIntervalInMinutes = 5; int _cachePrefetchSampleEligibilityHitsPerHour = 30; + bool _enableBlocking = true; DnsServerBlockingType _blockingType = DnsServerBlockingType.AnyAddress; IReadOnlyCollection _customBlockingARecords = Array.Empty(); IReadOnlyCollection _customBlockingAAAARecords = Array.Empty(); @@ -1723,6 +1724,10 @@ namespace DnsServerCore.Dns //this is since a blocked CNAME record could still be used by an allowed domain name and so must resolve inAllowedZone = true; } + else if (!_enableBlocking) + { + inAllowedZone = true; + } else { inAllowedZone = (_allowedZoneManager.TotalZonesAllowed > 0) && (_allowedZoneManager.Query(request) is not null); @@ -3197,6 +3202,12 @@ namespace DnsServerCore.Dns } } + public bool EnableBlocking + { + get { return _enableBlocking; } + set { _enableBlocking = value; } + } + public DnsServerBlockingType BlockingType { get { return _blockingType; }