private AuthZone CreateEmptyZone(AuthZoneInfo zoneInfo) { AuthZone zone; switch (zoneInfo.Type) { case AuthZoneType.Primary: zone = new PrimaryZone(_dnsServer, zoneInfo); break; case AuthZoneType.Secondary: zone = new SecondaryZone(_dnsServer, zoneInfo); break; case AuthZoneType.Stub: zone = new StubZone(_dnsServer, zoneInfo); break; case AuthZoneType.Forwarder: zone = new ForwarderZone(zoneInfo); break; default: throw new InvalidDataException("DNS zone type not supported."); } if (_root.TryAdd(zone)) { return(zone); } throw new DnsServerException("Zone already exists: " + zoneInfo.Name); }
internal AuthZoneInfo CreateInternalPrimaryZone(string domain, DnsSOARecord soaRecord, DnsNSRecord ns) { AuthZone authZone = new PrimaryZone(_dnsServer, domain, soaRecord, ns); if (_root.TryAdd(authZone)) { return(new AuthZoneInfo(authZone)); } return(null); }
public AuthZoneInfo CreatePrimaryZone(string domain, string primaryNameServer, bool @internal) { AuthZone authZone = new PrimaryZone(_dnsServer, domain, primaryNameServer, @internal); if (_root.TryAdd(authZone)) { return(new AuthZoneInfo(authZone)); } return(null); }
public AuthZoneInfo CreatePrimaryZone(string domain, string primaryNameServer, bool @internal) { AuthZone authZone = new PrimaryZone(_dnsServer, domain, primaryNameServer, @internal); if (_root.TryAdd(authZone)) { return(new AuthZoneInfo(authZone)); } if (_root.TryGet(domain, out AuthZone existingZone) && (existingZone is SubDomainZone)) { _root[domain] = authZone; return(new AuthZoneInfo(authZone)); } return(null); }