From 07c7a8c5b7ac11f500b361b8724c8e2aaae3cc2b Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 14 Jun 2020 12:40:40 +0530 Subject: [PATCH] renamed MasterNameServer to PrimaryNameServer. --- DnsServerCore/Dns/DnsServer.cs | 2 +- .../DnsResourceRecordExtension.cs | 4 +-- .../Dns/ZoneManagers/AllowedZoneManager.cs | 4 +-- .../Dns/ZoneManagers/AuthZoneManager.cs | 14 ++++---- .../Dns/ZoneManagers/BlockListZoneManager.cs | 4 +-- .../Dns/ZoneManagers/BlockedZoneManager.cs | 4 +-- DnsServerCore/Dns/Zones/PrimaryZone.cs | 10 +++--- DnsServerCore/Dns/Zones/SecondaryZone.cs | 10 +++--- DnsServerCore/Dns/Zones/StubZone.cs | 8 ++--- DnsServerCore/WebService.cs | 28 ++++++++-------- DnsServerCore/www/index.html | 10 +++--- DnsServerCore/www/js/zone.js | 32 +++++++++---------- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/DnsServerCore/Dns/DnsServer.cs b/DnsServerCore/Dns/DnsServer.cs index 909ae3c5..db587ab7 100644 --- a/DnsServerCore/Dns/DnsServer.cs +++ b/DnsServerCore/Dns/DnsServer.cs @@ -1037,7 +1037,7 @@ namespace DnsServerCore.Dns try { - DnsDatagram response = DirectQuery(new DnsQuestionRecord((soaRecord.RDATA as DnsSOARecord).MasterNameServer, type, DnsClass.IN)); + DnsDatagram response = DirectQuery(new DnsQuestionRecord((soaRecord.RDATA as DnsSOARecord).PrimaryNameServer, type, DnsClass.IN)); if (response != null) { IReadOnlyList addresses; diff --git a/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordExtension.cs b/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordExtension.cs index 0d96e8fa..87acc54d 100644 --- a/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordExtension.cs +++ b/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordExtension.cs @@ -56,7 +56,7 @@ namespace DnsServerCore.Dns.ResourceRecords break; case DnsResourceRecordType.SOA: - domain = (record.RDATA as DnsSOARecord).MasterNameServer; + domain = (record.RDATA as DnsSOARecord).PrimaryNameServer; break; default: @@ -100,7 +100,7 @@ namespace DnsServerCore.Dns.ResourceRecords break; case DnsResourceRecordType.SOA: - domain = (record.RDATA as DnsSOARecord).MasterNameServer; + domain = (record.RDATA as DnsSOARecord).PrimaryNameServer; break; default: diff --git a/DnsServerCore/Dns/ZoneManagers/AllowedZoneManager.cs b/DnsServerCore/Dns/ZoneManagers/AllowedZoneManager.cs index 3c3da66b..f76c03f0 100644 --- a/DnsServerCore/Dns/ZoneManagers/AllowedZoneManager.cs +++ b/DnsServerCore/Dns/ZoneManagers/AllowedZoneManager.cs @@ -59,7 +59,7 @@ namespace DnsServerCore.Dns.ZoneManagers private void UpdateServerDomain(string serverDomain) { - _soaRecord = new DnsSOARecord(serverDomain, "hostmaster." + serverDomain, 1, 14400, 3600, 604800, 900); + _soaRecord = new DnsSOARecord(serverDomain, "hostadmin." + serverDomain, 1, 14400, 3600, 604800, 900); _nsRecord = new DnsNSRecord(serverDomain); } @@ -187,7 +187,7 @@ namespace DnsServerCore.Dns.ZoneManagers public string ServerDomain { - get { return _soaRecord.MasterNameServer; } + get { return _soaRecord.PrimaryNameServer; } set { UpdateServerDomain(value); } } diff --git a/DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs b/DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs index bc1439d5..7272f327 100644 --- a/DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs +++ b/DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs @@ -106,7 +106,7 @@ namespace DnsServerCore.Dns.ZoneManagers DnsResourceRecord record = zone.GetRecords(DnsResourceRecordType.SOA)[0]; DnsSOARecord soa = record.RDATA as DnsSOARecord; - if (soa.MasterNameServer.Equals(_serverDomain, StringComparison.OrdinalIgnoreCase)) + if (soa.PrimaryNameServer.Equals(_serverDomain, StringComparison.OrdinalIgnoreCase)) { string responsiblePerson = soa.ResponsiblePerson; if (responsiblePerson.EndsWith(_serverDomain)) @@ -373,9 +373,9 @@ namespace DnsServerCore.Dns.ZoneManagers #region public - public AuthZoneInfo CreatePrimaryZone(string domain, string masterNameServer, bool @internal) + public AuthZoneInfo CreatePrimaryZone(string domain, string primaryNameServer, bool @internal) { - AuthZone authZone = new PrimaryZone(_dnsServer, domain, masterNameServer, @internal); + AuthZone authZone = new PrimaryZone(_dnsServer, domain, primaryNameServer, @internal); if (_root.TryAdd(authZone)) return new AuthZoneInfo(authZone); @@ -393,9 +393,9 @@ namespace DnsServerCore.Dns.ZoneManagers return null; } - public AuthZoneInfo CreateSecondaryZone(string domain, string masterNameServer = null, string glueAddresses = null) + public AuthZoneInfo CreateSecondaryZone(string domain, string primaryNameServer = null, string glueAddresses = null) { - AuthZone authZone = new SecondaryZone(_dnsServer, domain, masterNameServer, glueAddresses); + AuthZone authZone = new SecondaryZone(_dnsServer, domain, primaryNameServer, glueAddresses); if (_root.TryAdd(authZone)) { @@ -406,9 +406,9 @@ namespace DnsServerCore.Dns.ZoneManagers return null; } - public AuthZoneInfo CreateStubZone(string domain, string masterNameServer = null, string glueAddresses = null) + public AuthZoneInfo CreateStubZone(string domain, string primaryNameServer = null, string glueAddresses = null) { - AuthZone authZone = new StubZone(_dnsServer, domain, masterNameServer, glueAddresses); + AuthZone authZone = new StubZone(_dnsServer, domain, primaryNameServer, glueAddresses); if (_root.TryAdd(authZone)) { diff --git a/DnsServerCore/Dns/ZoneManagers/BlockListZoneManager.cs b/DnsServerCore/Dns/ZoneManagers/BlockListZoneManager.cs index 873ead35..6050ffdd 100644 --- a/DnsServerCore/Dns/ZoneManagers/BlockListZoneManager.cs +++ b/DnsServerCore/Dns/ZoneManagers/BlockListZoneManager.cs @@ -69,7 +69,7 @@ namespace DnsServerCore.Dns.ZoneManagers private void UpdateServerDomain(string serverDomain) { - _soaRecord = new DnsSOARecord(serverDomain, "hostmaster." + serverDomain, 1, 14400, 3600, 604800, 900); + _soaRecord = new DnsSOARecord(serverDomain, "hostadmin." + serverDomain, 1, 14400, 3600, 604800, 900); _nsRecord = new DnsNSRecord(serverDomain); } @@ -406,7 +406,7 @@ namespace DnsServerCore.Dns.ZoneManagers public string ServerDomain { - get { return _soaRecord.MasterNameServer; } + get { return _soaRecord.PrimaryNameServer; } set { UpdateServerDomain(value); } } diff --git a/DnsServerCore/Dns/ZoneManagers/BlockedZoneManager.cs b/DnsServerCore/Dns/ZoneManagers/BlockedZoneManager.cs index c7ae6397..b4695fa1 100644 --- a/DnsServerCore/Dns/ZoneManagers/BlockedZoneManager.cs +++ b/DnsServerCore/Dns/ZoneManagers/BlockedZoneManager.cs @@ -59,7 +59,7 @@ namespace DnsServerCore.Dns.ZoneManagers private void UpdateServerDomain(string serverDomain) { - _soaRecord = new DnsSOARecord(serverDomain, "hostmaster." + serverDomain, 1, 14400, 3600, 604800, 900); + _soaRecord = new DnsSOARecord(serverDomain, "hostadmin." + serverDomain, 1, 14400, 3600, 604800, 900); _nsRecord = new DnsNSRecord(serverDomain); } @@ -189,7 +189,7 @@ namespace DnsServerCore.Dns.ZoneManagers public string ServerDomain { - get { return _soaRecord.MasterNameServer; } + get { return _soaRecord.PrimaryNameServer; } set { UpdateServerDomain(value); } } diff --git a/DnsServerCore/Dns/Zones/PrimaryZone.cs b/DnsServerCore/Dns/Zones/PrimaryZone.cs index 00cbc8d9..885c977e 100644 --- a/DnsServerCore/Dns/Zones/PrimaryZone.cs +++ b/DnsServerCore/Dns/Zones/PrimaryZone.cs @@ -55,16 +55,16 @@ namespace DnsServerCore.Dns.Zones _notifyTimer = new Timer(NotifyTimerCallback, null, Timeout.Infinite, Timeout.Infinite); } - public PrimaryZone(DnsServer dnsServer, string name, string masterNameServer, bool @internal) + public PrimaryZone(DnsServer dnsServer, string name, string primaryNameServer, bool @internal) : base(name) { _dnsServer = dnsServer; _internal = @internal; - DnsSOARecord soa = new DnsSOARecord(masterNameServer, "hostmaster." + masterNameServer, 1, 14400, 3600, 604800, 900); + DnsSOARecord soa = new DnsSOARecord(primaryNameServer, "hostadmin." + primaryNameServer, 1, 14400, 3600, 604800, 900); _entries[DnsResourceRecordType.SOA] = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.SOA, DnsClass.IN, soa.Refresh, soa) }; - _entries[DnsResourceRecordType.NS] = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.MasterNameServer)) }; + _entries[DnsResourceRecordType.NS] = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.PrimaryNameServer)) }; _notifyTimer = new Timer(NotifyTimerCallback, null, Timeout.Infinite, Timeout.Infinite); } @@ -115,7 +115,7 @@ namespace DnsServerCore.Dns.Zones { string nsDomain = (nsRecord.RDATA as DnsNSRecord).NameServer; - if (soa.MasterNameServer.Equals(nsDomain, StringComparison.OrdinalIgnoreCase)) + if (soa.PrimaryNameServer.Equals(nsDomain, StringComparison.OrdinalIgnoreCase)) continue; //dont notify self IReadOnlyList glueRecords = nsRecord.GetGlueRecords(); @@ -243,7 +243,7 @@ namespace DnsServerCore.Dns.Zones else serial = 0; - DnsResourceRecord newRecord = new DnsResourceRecord(record.Name, record.Type, record.Class, record.TtlValue, new DnsSOARecord(soa.MasterNameServer, soa.ResponsiblePerson, serial, soa.Refresh, soa.Retry, soa.Expire, soa.Minimum)) { Tag = record.Tag }; + DnsResourceRecord newRecord = new DnsResourceRecord(record.Name, record.Type, record.Class, record.TtlValue, new DnsSOARecord(soa.PrimaryNameServer, soa.ResponsiblePerson, serial, soa.Refresh, soa.Retry, soa.Expire, soa.Minimum)) { Tag = record.Tag }; _entries[DnsResourceRecordType.SOA] = new DnsResourceRecord[] { newRecord }; } diff --git a/DnsServerCore/Dns/Zones/SecondaryZone.cs b/DnsServerCore/Dns/Zones/SecondaryZone.cs index 65f4961e..6cb8a033 100644 --- a/DnsServerCore/Dns/Zones/SecondaryZone.cs +++ b/DnsServerCore/Dns/Zones/SecondaryZone.cs @@ -58,12 +58,12 @@ namespace DnsServerCore.Dns.Zones _refreshTimer = new Timer(RefreshTimerCallback, null, Timeout.Infinite, Timeout.Infinite); } - public SecondaryZone(DnsServer dnsServer, string name, string masterNameServer = null, string glueAddresses = null) + public SecondaryZone(DnsServer dnsServer, string name, string primaryNameServer = null, string glueAddresses = null) : base(name) { _dnsServer = dnsServer; - if (masterNameServer == null) + if (primaryNameServer == null) { DnsDatagram soaResponse = _dnsServer.DirectQuery(new DnsQuestionRecord(name, DnsResourceRecordType.SOA, DnsClass.IN)); if ((soaResponse == null) || (soaResponse.Answer.Count == 0) || (soaResponse.Answer[0].Type != DnsResourceRecordType.SOA)) @@ -98,10 +98,10 @@ namespace DnsServerCore.Dns.Zones } else { - DnsSOARecord soa = new DnsSOARecord(masterNameServer, "hostmaster." + masterNameServer, 1, 14400, 3600, 604800, 900); + DnsSOARecord soa = new DnsSOARecord(primaryNameServer, "hostadmin." + primaryNameServer, 1, 14400, 3600, 604800, 900); DnsResourceRecord[] soaRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.SOA, DnsClass.IN, soa.Refresh, soa) }; - DnsResourceRecord[] nsRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.MasterNameServer)) }; ; + DnsResourceRecord[] nsRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.PrimaryNameServer)) }; ; if (glueAddresses != null) { @@ -154,7 +154,7 @@ namespace DnsServerCore.Dns.Zones _isExpired = DateTime.UtcNow > _expiry; //get primary name server addresses - string primaryNameServer = soa.MasterNameServer; + string primaryNameServer = soa.PrimaryNameServer; List primaryNameServers = new List(); IReadOnlyList glueRecords = soaRecord.GetGlueRecords(); diff --git a/DnsServerCore/Dns/Zones/StubZone.cs b/DnsServerCore/Dns/Zones/StubZone.cs index 70702a79..e84cb038 100644 --- a/DnsServerCore/Dns/Zones/StubZone.cs +++ b/DnsServerCore/Dns/Zones/StubZone.cs @@ -58,12 +58,12 @@ namespace DnsServerCore.Dns.Zones _refreshTimer = new Timer(RefreshTimerCallback, null, Timeout.Infinite, Timeout.Infinite); } - public StubZone(DnsServer dnsServer, string name, string masterNameServer = null, string glueAddresses = null) + public StubZone(DnsServer dnsServer, string name, string primaryNameServer = null, string glueAddresses = null) : base(name) { _dnsServer = dnsServer; - if (masterNameServer == null) + if (primaryNameServer == null) { DnsDatagram soaResponse = _dnsServer.DirectQuery(new DnsQuestionRecord(name, DnsResourceRecordType.SOA, DnsClass.IN)); if ((soaResponse == null) || (soaResponse.Answer.Count == 0) || (soaResponse.Answer[0].Type != DnsResourceRecordType.SOA)) @@ -101,10 +101,10 @@ namespace DnsServerCore.Dns.Zones } else { - DnsSOARecord soa = new DnsSOARecord(masterNameServer, "hostmaster." + masterNameServer, 1, 14400, 3600, 604800, 900); + DnsSOARecord soa = new DnsSOARecord(primaryNameServer, "hostadmin." + primaryNameServer, 1, 14400, 3600, 604800, 900); DnsResourceRecord[] soaRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.SOA, DnsClass.IN, soa.Refresh, soa) }; - DnsResourceRecord[] nsRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.MasterNameServer)) }; ; + DnsResourceRecord[] nsRR = new DnsResourceRecord[] { new DnsResourceRecord(_name, DnsResourceRecordType.NS, DnsClass.IN, soa.Refresh, new DnsNSRecord(soa.PrimaryNameServer)) }; ; if (glueAddresses != null) { diff --git a/DnsServerCore/WebService.cs b/DnsServerCore/WebService.cs index 924f4935..c5030917 100644 --- a/DnsServerCore/WebService.cs +++ b/DnsServerCore/WebService.cs @@ -2071,15 +2071,15 @@ namespace DnsServerCore case AuthZoneType.Secondary: { - string strMasterNameServer = request.QueryString["masterNameServer"]; - if (string.IsNullOrEmpty(strMasterNameServer)) - strMasterNameServer = null; + string strPrimaryNameServer = request.QueryString["primaryNameServer"]; + if (string.IsNullOrEmpty(strPrimaryNameServer)) + strPrimaryNameServer = null; string strGlueAddresses = request.QueryString["glueAddresses"]; if (string.IsNullOrEmpty(strGlueAddresses)) strGlueAddresses = null; - if (_dnsServer.AuthZoneManager.CreateSecondaryZone(domain, strMasterNameServer, strGlueAddresses) != null) + if (_dnsServer.AuthZoneManager.CreateSecondaryZone(domain, strPrimaryNameServer, strGlueAddresses) != null) { _log.Write(GetRequestRemoteEndPoint(request), "[" + GetSession(request).Username + "] Authoritative secondary zone was created: " + domain); _dnsServer.AuthZoneManager.SaveZoneFile(domain); @@ -2089,15 +2089,15 @@ namespace DnsServerCore case AuthZoneType.Stub: { - string strMasterNameServer = request.QueryString["masterNameServer"]; - if (string.IsNullOrEmpty(strMasterNameServer)) - strMasterNameServer = null; + string strPrimaryNameServer = request.QueryString["primaryNameServer"]; + if (string.IsNullOrEmpty(strPrimaryNameServer)) + strPrimaryNameServer = null; string strGlueAddresses = request.QueryString["glueAddresses"]; if (string.IsNullOrEmpty(strGlueAddresses)) strGlueAddresses = null; - if (_dnsServer.AuthZoneManager.CreateStubZone(domain, strMasterNameServer, strGlueAddresses) != null) + if (_dnsServer.AuthZoneManager.CreateStubZone(domain, strPrimaryNameServer, strGlueAddresses) != null) { _log.Write(GetRequestRemoteEndPoint(request), "[" + GetSession(request).Username + "] Stub zone was created: " + domain); _dnsServer.AuthZoneManager.SaveZoneFile(domain); @@ -2490,8 +2490,8 @@ namespace DnsServerCore DnsSOARecord rdata = record.RDATA as DnsSOARecord; if (rdata != null) { - jsonWriter.WritePropertyName("masterNameServer"); - jsonWriter.WriteValue(rdata.MasterNameServer); + jsonWriter.WritePropertyName("primaryNameServer"); + jsonWriter.WriteValue(rdata.PrimaryNameServer); jsonWriter.WritePropertyName("responsiblePerson"); jsonWriter.WriteValue(rdata.ResponsiblePerson); @@ -2938,9 +2938,9 @@ namespace DnsServerCore case DnsResourceRecordType.SOA: { - string masterNameServer = request.QueryString["masterNameServer"]; - if (string.IsNullOrEmpty(masterNameServer)) - throw new WebServiceException("Parameter 'masterNameServer' missing."); + string primaryNameServer = request.QueryString["primaryNameServer"]; + if (string.IsNullOrEmpty(primaryNameServer)) + throw new WebServiceException("Parameter 'primaryNameServer' missing."); string responsiblePerson = request.QueryString["responsiblePerson"]; if (string.IsNullOrEmpty(responsiblePerson)) @@ -2966,7 +2966,7 @@ namespace DnsServerCore if (string.IsNullOrEmpty(minimum)) throw new WebServiceException("Parameter 'minimum' missing."); - DnsResourceRecord soaRecord = new DnsResourceRecord(domain, type, DnsClass.IN, ttl, new DnsSOARecord(masterNameServer, responsiblePerson, uint.Parse(serial), uint.Parse(refresh), uint.Parse(retry), uint.Parse(expire), uint.Parse(minimum))); + DnsResourceRecord soaRecord = new DnsResourceRecord(domain, type, DnsClass.IN, ttl, new DnsSOARecord(primaryNameServer, responsiblePerson, uint.Parse(serial), uint.Parse(refresh), uint.Parse(retry), uint.Parse(expire), uint.Parse(minimum))); string glueAddresses = request.QueryString["glue"]; if (!string.IsNullOrEmpty(glueAddresses)) diff --git a/DnsServerCore/www/index.html b/DnsServerCore/www/index.html index 1403f2bb..44f588a4 100644 --- a/DnsServerCore/www/index.html +++ b/DnsServerCore/www/index.html @@ -1456,10 +1456,10 @@ -
- +
+
- +
@@ -1608,9 +1608,9 @@