mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-02-28 02:34:10 +00:00
WebServiceZonesApi: Added validatation code to prevent adding/updating glue addresses for zone's NS records.
This commit is contained in:
@@ -3244,7 +3244,12 @@ namespace DnsServerCore
|
||||
newRecord = new DnsResourceRecord(domain, type, DnsClass.IN, ttl, new DnsNSRecordData(nameServer));
|
||||
|
||||
if (!string.IsNullOrEmpty(glueAddresses))
|
||||
{
|
||||
if (zoneInfo.Name.Equals(domain, StringComparison.OrdinalIgnoreCase))
|
||||
throw new DnsWebServiceException("The zone's own NS records cannot have glue addresses. Please add separate A/AAAA records in the zone instead.");
|
||||
|
||||
newRecord.SetGlueRecords(glueAddresses);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3994,7 +3999,12 @@ namespace DnsServerCore
|
||||
newRecord = new DnsResourceRecord(newDomain, type, DnsClass.IN, ttl, new DnsNSRecordData(newNameServer));
|
||||
|
||||
if (request.TryGetQueryOrForm("glue", out string glueAddresses))
|
||||
{
|
||||
if (zoneInfo.Name.Equals(domain, StringComparison.OrdinalIgnoreCase))
|
||||
throw new DnsWebServiceException("The zone's own NS records cannot have glue addresses. Please add separate A/AAAA records in the zone instead.");
|
||||
|
||||
newRecord.SetGlueRecords(glueAddresses);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user