-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
NsRecord.cs
62 lines (53 loc) · 2.33 KB
/
NsRecord.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
namespace DnsClient.Protocol
{
/*
https://tools.ietf.org/html/rfc1035#section-3.3.11:
NS RDATA format
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ NSDNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
NSDNAME A <domain-name> which specifies a host which should be
authoritative for the specified class and domain.
NS records cause both the usual additional section processing to locate
a type A record, and, when used in a referral, a special search of the
zone in which they reside for glue information.
The NS RR states that the named host should be expected to have a zone
starting at owner name of the specified class. Note that the class may
not indicate the protocol family which should be used to communicate
with the host, although it is typically a strong hint. For example,
hosts which are name servers for either Internet (IN) or Hesiod (HS)
class information are normally queried using IN class protocols.
*/
/// <summary>
/// A <see cref="DnsResourceRecord"/> representing an authoritative name server.
/// </summary>
/// <seealso href="https://tools.ietf.org/html/rfc1035#section-3.3.11">RFC 1035</seealso>
public class NsRecord : DnsResourceRecord
{
/// <summary>
/// Gets the domain name which specifies a host which should be authoritative for the specified class and domain.
/// </summary>
/// <value>
/// The domain name.
/// </value>
public DnsString NSDName { get; }
/// <summary>
/// Initializes a new instance of the <see cref="NsRecord"/> class.
/// </summary>
/// <param name="info">The information.</param>
/// <param name="name">The name.</param>
/// <exception cref="ArgumentNullException">If <paramref name="name"/> or <paramref name="info"/> is null.</exception>
public NsRecord(ResourceRecordInfo info, DnsString name)
: base(info)
{
NSDName = name ?? throw new ArgumentNullException(nameof(name));
}
private protected override string RecordToString()
{
return NSDName.Value;
}
}
}