diff --git a/DnsServerCore/Dns/Zones/CacheZone.cs b/DnsServerCore/Dns/Zones/CacheZone.cs index d9d5f978..45fbe3e5 100644 --- a/DnsServerCore/Dns/Zones/CacheZone.cs +++ b/DnsServerCore/Dns/Zones/CacheZone.cs @@ -167,8 +167,21 @@ namespace DnsServerCore.Dns.Zones public override bool ContainsNameServerRecords() { - IReadOnlyList records = QueryRecords(DnsResourceRecordType.NS, false); - return (records.Count > 0) && (records[0].Type == DnsResourceRecordType.NS); + if (!_entries.TryGetValue(DnsResourceRecordType.NS, out IReadOnlyList records)) + return false; + + foreach (DnsResourceRecord record in records) + { + if (record.IsStale) + continue; + + if (record.TtlValue < 1u) + continue; + + return true; + } + + return false; } #endregion