Example #1
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsSOARecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 /// <param name="primaryServer">Domain Name of the original or primary source of data for this zone</param>
 /// <param name="responsiblePerson">A domain name which specifies the mailbox of the person responsible for this zone</param>
 /// <param name="serial">Version number of the zone</param>
 /// <param name="refreshInterval">Interval before the zone should be refreshed</param>
 /// <param name="retryDelay">Time interval that should elapse before a failed refresh should be retried</param>
 /// <param name="expireLimit">The upper limit on the time interval that can elapse before the zone is no longer authoritative</param>
 /// <param name="minimumTimeToLive">The minimum time-to-live (TTL) that should be exported with an record from this zone</param>
 public DnsSOARecord(string name, DnsRecordClasses @class, TimeSpan timeToLive,
                     string primaryServer, string responsiblePerson, uint serial, TimeSpan refreshInterval,
                     TimeSpan retryDelay, TimeSpan expireLimit, TimeSpan minimumTimeToLive)
     : this(zone : null, name, @class, timeToLive, primaryServer, responsiblePerson,
            serial, refreshInterval, retryDelay, expireLimit, minimumTimeToLive)
 {
 }
Example #2
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsCNAMERecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        /// <param name="primaryName">Primary Name for <see cref="DnsRecord.Name"/></param>
        public DnsCNAMERecord(DnsZone zone, string name, DnsRecordClasses @class, TimeSpan timeToLive, string primaryName)
            : base(zone, name, DnsRecordTypes.CNAME, @class, timeToLive)
        {
            if (string.IsNullOrWhiteSpace(primaryName))
            {
                throw new ArgumentNullException(nameof(primaryName));
            }

            PrimaryName = primaryName;
        }
Example #3
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsNSRecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        /// <param name="nameServer">A host which should be authoritative for the domain</param>
        public DnsNSRecord(DnsZone zone, string name, DnsRecordClasses @class, TimeSpan timeToLive, string nameServer)
            : base(zone, name, DnsRecordTypes.NS, @class, timeToLive)
        {
            if (string.IsNullOrWhiteSpace(nameServer))
            {
                throw new ArgumentNullException(nameof(nameServer));
            }

            NameServer = nameServer;
        }
Example #4
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsPTRRecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        /// <param name="domainName">Pointer Domain Name</param>
        public DnsPTRRecord(DnsZone zone, string name, DnsRecordClasses @class, TimeSpan timeToLive, string domainName)
            : base(zone, name, DnsRecordTypes.PTR, @class, timeToLive)
        {
            if (string.IsNullOrWhiteSpace(domainName))
            {
                throw new ArgumentNullException(nameof(domainName));
            }

            DomainName = domainName;
        }
Example #5
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsMXRecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        /// <param name="preference">Preference given to this record</param>
        /// <param name="domainName">Mail Exchange Domain Name</param>
        public DnsMXRecord(DnsZone zone, string name, DnsRecordClasses @class, TimeSpan timeToLive, ushort preference, string domainName)
            : base(zone, name, DnsRecordTypes.MX, @class, timeToLive)
        {
            if (string.IsNullOrWhiteSpace(domainName))
            {
                throw new ArgumentNullException(domainName);
            }

            Preference = preference;
            DomainName = domainName;
        }
Example #6
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsRecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="type">Record type</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        public DnsRecord(DnsZone zone, string name, DnsRecordTypes type, DnsRecordClasses @class, TimeSpan timeToLive)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (timeToLive.Ticks < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(timeToLive));
            }

            Zone       = zone;
            Name       = name;
            Type       = type;
            Class      = @class;
            TimeToLive = timeToLive;
        }
Example #7
0
        /// <summary>
        /// Constructs a new instance of <see cref="DnsSOARecord"/>.
        /// </summary>
        /// <param name="zone">Associated zone</param>
        /// <param name="name">Owner name</param>
        /// <param name="class">Record class</param>
        /// <param name="timeToLive">Record time to live (TTL)</param>
        /// <param name="primaryServer">Domain Name of the original or primary source of data for this zone</param>
        /// <param name="responsiblePerson">A domain name which specifies the mailbox of the person responsible for this zone</param>
        /// <param name="serial">Version number of the zone</param>
        /// <param name="refreshInterval">Interval before the zone should be refreshed</param>
        /// <param name="retryDelay">Time interval that should elapse before a failed refresh should be retried</param>
        /// <param name="expireLimit">The upper limit on the time interval that can elapse before the zone is no longer authoritative</param>
        /// <param name="minimumTimeToLive">The minimum time-to-live (TTL) that should be exported with an record from this zone</param>
        public DnsSOARecord(DnsZone zone, string name, DnsRecordClasses @class, TimeSpan timeToLive,
                            string primaryServer, string responsiblePerson, uint serial, TimeSpan refreshInterval,
                            TimeSpan retryDelay, TimeSpan expireLimit, TimeSpan minimumTimeToLive)
            : base(zone, name, DnsRecordTypes.SOA, @class, timeToLive)
        {
            if (string.IsNullOrWhiteSpace(primaryServer))
            {
                throw new ArgumentNullException(nameof(primaryServer));
            }
            if (string.IsNullOrWhiteSpace(responsiblePerson))
            {
                throw new ArgumentNullException(nameof(responsiblePerson));
            }
            if (refreshInterval.Ticks < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(refreshInterval));
            }
            if (retryDelay.Ticks < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(retryDelay));
            }
            if (expireLimit.Ticks < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(expireLimit));
            }
            if (minimumTimeToLive.Ticks < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(minimumTimeToLive));
            }

            PrimaryServer     = primaryServer;
            ResponsiblePerson = responsiblePerson;
            Serial            = serial;
            RefreshInterval   = refreshInterval;
            RetryDelay        = retryDelay;
            ExpireLimit       = expireLimit;
            MinimumTimeToLive = minimumTimeToLive;
        }
Example #8
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsCNAMERecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 /// <param name="primaryName">Primary Name for <see cref="DnsRecord.Name"/></param>
 public DnsCNAMERecord(string name, DnsRecordClasses @class, TimeSpan timeToLive, string primaryName)
     : this(zone : null, name, @class, timeToLive, primaryName)
 {
 }
Example #9
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsNSRecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 /// <param name="nameServer">A host which should be authoritative for the domain</param>
 public DnsNSRecord(string name, DnsRecordClasses @class, TimeSpan timeToLive, string nameServer)
     : this(zone : null, name, @class, timeToLive, nameServer)
 {
 }
Example #10
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsRecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="type">Record type</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 public DnsRecord(string name, DnsRecordTypes type, DnsRecordClasses @class, TimeSpan timeToLive)
     : this(zone : null, name, type, @class, timeToLive)
 {
 }
Example #11
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsMXRecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 /// <param name="preference">Preference given to this record</param>
 /// <param name="domainName">Mail Exchange Domain Name</param>
 public DnsMXRecord(string name, DnsRecordClasses @class, TimeSpan timeToLive, ushort preference, string domainName)
     : this(zone : null, name, @class, timeToLive, preference, domainName)
 {
 }
Example #12
0
 /// <summary>
 /// Constructs a new instance of <see cref="DnsPTRRecord"/>.
 /// </summary>
 /// <param name="name">Owner name</param>
 /// <param name="class">Record class</param>
 /// <param name="timeToLive">Record time to live (TTL)</param>
 /// <param name="domainName">Pointer Domain Name</param>
 public DnsPTRRecord(string name, DnsRecordClasses @class, TimeSpan timeToLive, string domainName)
     : this(zone : null, name, @class, timeToLive, domainName)
 {
 }