Blockcore.Features.Dns.DnsSeedMasterFile.Seed C# (CSharp) Метод

Seed() публичный Метод

public Seed ( Blockcore.Features.Dns.DnsSettings dnsSettings ) : void
dnsSettings Blockcore.Features.Dns.DnsSettings
Результат void
        public void Seed(DnsSettings dnsSettings)
        {
            // Check if SOA record exists for host.
            int count = this.Get(new Question(new Domain(dnsSettings.DnsHostName), RecordType.SOA)).Count;
            if (count == 0)
            {
                // Add SOA record for host.
                this.entries.Add(new StartOfAuthorityResourceRecord(new Domain(dnsSettings.DnsHostName), new Domain(dnsSettings.DnsNameServer), new Domain(dnsSettings.DnsMailBox.Replace('@', '.'))));
            }

            // Check if NS record exists for host.
            count = this.Get(new Question(new Domain(dnsSettings.DnsHostName), RecordType.NS)).Count;
            if (count == 0)
            {
                // Add NS record for host.
                this.entries.Add(new NameServerResourceRecord(new Domain(dnsSettings.DnsHostName), new Domain(dnsSettings.DnsNameServer)));
            }
        }
    }