From 7ceb70c0e663f6e98810bc5470fc3f7b4801eeb9 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 13 Jun 2020 13:39:39 +0530 Subject: [PATCH] ForwarderZone: Updated constructor to correctly create zone. --- DnsServerCore/Dns/Zones/ForwarderZone.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/Dns/Zones/ForwarderZone.cs b/DnsServerCore/Dns/Zones/ForwarderZone.cs index 6fd00054..9d534c39 100644 --- a/DnsServerCore/Dns/Zones/ForwarderZone.cs +++ b/DnsServerCore/Dns/Zones/ForwarderZone.cs @@ -17,6 +17,9 @@ along with this program. If not, see . */ +using TechnitiumLibrary.Net.Dns; +using TechnitiumLibrary.Net.Dns.ResourceRecords; + namespace DnsServerCore.Dns.Zones { public sealed class ForwarderZone : AuthZone @@ -29,9 +32,13 @@ namespace DnsServerCore.Dns.Zones _disabled = zoneInfo.Disabled; } - public ForwarderZone(string name) + public ForwarderZone(string name, DnsTransportProtocol forwarderProtocol, string forwarder) : base(name) - { } + { + DnsResourceRecord fwdRecord = new DnsResourceRecord(name, DnsResourceRecordType.FWD, DnsClass.IN, 0, new DnsForwarderRecord(forwarderProtocol, forwarder)); + + _entries[DnsResourceRecordType.FWD] = new DnsResourceRecord[] { fwdRecord }; + } #endregion }