Class Catalog
A dictionary of Node.
Implements
Inherited Members
Namespace: Makaretu.Dns.Resolving
Assembly: Makaretu.Dns.dll
Syntax
public class Catalog : ConcurrentDictionary<DomainName, Node>, IDictionary<DomainName, Node>, ICollection<KeyValuePair<DomainName, Node>>, IDictionary, ICollection, IReadOnlyDictionary<DomainName, Node>, IReadOnlyCollection<KeyValuePair<DomainName, Node>>, IEnumerable<KeyValuePair<DomainName, Node>>, IEnumerable
Remarks
This is a portion of the DNS distribute database.
The key is the case insensitive Name and the value is a Node.
Methods
| Improve this Doc View SourceAdd(ResourceRecord, Boolean)
Add or update the resource record to the catalog.
Declaration
public Node Add(ResourceRecord resource, bool authoritative = false)
Parameters
Type | Name | Description |
---|---|---|
ResourceRecord | resource | The Name is also the name of the node. |
Boolean | authoritative | Indicates if the |
Returns
Type | Description |
---|---|
Node | The Node that was created or updated. |
Remarks
If the resource
already exists, then update the
non-equality properties TTL
and CreationTime.
Include(PresentationReader, Boolean)
Include the resource records.
Declaration
public void Include(PresentationReader reader, bool authoritative = false)
Parameters
Type | Name | Description |
---|---|---|
PresentationReader | reader | The source of the resource records. |
Boolean | authoritative | Indicates if a ResourceRecord is authoritative or cached. Only used when a Node is created. |
IncludeReverseLookupRecords()
Add PTR records for each authoritative A/AAAA record.
Declaration
public void IncludeReverseLookupRecords()
Remarks
This enables reverse DNS lookup of all address records.
IncludeRootHints()
Include the root name servers.
Declaration
public Node IncludeRootHints()
Returns
Type | Description |
---|---|
Node | The Node that represents the "root". |
Remarks
A DNS recursive resolver typically needs a "root hints file". This file contains the names and IP addresses of the authoritative name servers for the root zone, so the software can bootstrap the DNS resolution process.
IncludeZone(PresentationReader)
Include the zone information.
Declaration
public Node IncludeZone(PresentationReader reader)
Parameters
Type | Name | Description |
---|---|---|
PresentationReader | reader | The source of the zone information. |
Returns
Type | Description |
---|---|
Node | The Node that represents the zone. |
Remarks
All included nodes are marked as Authoritative.
NodesInCanonicalOrder()
Get a sequence of nodes in canonical order.
Declaration
public IEnumerable<Node> NodesInCanonicalOrder()
Returns
Type | Description |
---|---|
IEnumerable<Node> | A sequence of nodes in canonical order. |
Remarks
Node names are converted to US-ASCII lowercase and then sorted by their reversed labels.
RemoveZone(DomainName)
Remove all nodes that belong to the zone.
Declaration
public void RemoveZone(DomainName name)
Parameters
Type | Name | Description |
---|---|---|
DomainName | name | The name of the zone. |