Domain Detective

API Reference

Class

DnsPropagationAnalysis

Namespace DomainDetective
Assembly DomainDetective

Provides DNS propagation checks across many public servers.

Inheritance

  • Object
  • DnsPropagationAnalysis

Remarks

The analysis compares DNS answers from multiple resolvers to detect discrepancies during record updates.

Constructors

public DnsPropagationAnalysis() #

Initializes a new instance of the class.

Methods

public Void AddServer(PublicDnsEntry entry) #
Returns: Void

Adds the specified DNS server to the list of known servers if it is not already present.

Parameters

entry DomainDetective.PublicDnsEntry requiredposition: 0
The server entry to add.
public static Dictionary<String, List<DnsComparisonEntry>> CompareResults(IEnumerable<DnsPropagationResult> results) #
Returns: Dictionary<String, List<DnsComparisonEntry>>

Compares results from multiple servers and groups them by the set of records returned.

Parameters

results System.Collections.Generic.IEnumerable{DomainDetective.DnsPropagationResult} requiredposition: 0
The results to compare.

Returns

A dictionary keyed by the record returned and listing the servers along with their country and location.

public Void DisableServer(String ipAddress) #
Returns: Void

Disables a server so it is not used in queries.

Parameters

ipAddress System.String requiredposition: 0
IP address of the server.
public Void EnableServer(String ipAddress) #
Returns: Void

Enables a previously disabled server.

Parameters

ipAddress System.String requiredposition: 0
IP address of the server.
FilterServers 2 overloads
public IEnumerable<PublicDnsEntry> FilterServers(Nullable<CountryId> country = null, Nullable<LocationId> location = null, Nullable<Int32> take = null) #
Returns: IEnumerable<PublicDnsEntry>

Filters the configured servers optionally by country or location.

Parameters

country System.Nullable{DomainDetective.CountryId} = null optionalposition: 0
Country filter.
location System.Nullable{DomainDetective.LocationId} = null optionalposition: 1
Location filter.
take System.Nullable{System.Int32} = null optionalposition: 2
If specified, randomly selects this many servers.

Returns

The filtered server list.

public IEnumerable<PublicDnsEntry> FilterServers(DnsServerQuery query) #
Returns: IEnumerable<PublicDnsEntry>

Filters servers using a DnsServerQuery builder.

Parameters

query DomainDetective.DnsServerQuery requiredposition: 0
Query builder specifying filters.

Returns

The filtered server list.

public static List<DnsComparisonDetail> GetComparisonDetails(IEnumerable<DnsPropagationResult> results) #
Returns: List<DnsComparisonDetail>

Flattens comparison results into DnsComparisonDetail objects.

Parameters

results System.Collections.Generic.IEnumerable{DomainDetective.DnsPropagationResult} requiredposition: 0
The results to analyze.

Returns

List of details for each server and record set.

public IEnumerable<String> GetSnapshotChanges(String domain, DnsRecordType recordType, IEnumerable<DnsPropagationResult> results) #
Returns: IEnumerable<String>

Returns line level differences between results and the latest snapshot.

Parameters

domain System.String requiredposition: 0
Queried domain name.
recordType DnsClientX.DnsRecordType requiredposition: 1
DNS record type.
results System.Collections.Generic.IEnumerable{DomainDetective.DnsPropagationResult} requiredposition: 2
Current query results.

Returns

List of diff lines.

public Void LoadBuiltinServers(Boolean clearExisting = true) #
Returns: Void

Loads DNS servers from the embedded resource.

Parameters

clearExisting System.Boolean = true optionalposition: 0
Whether to clear existing entries.
public Void LoadServers(String filePath, Boolean clearExisting = false) #
Returns: Void

Loads DNS server definitions from a JSON file.

Parameters

filePath System.String requiredposition: 0
Path to the JSON file.
clearExisting System.Boolean = false optionalposition: 1
Whether to clear any existing servers before loading.
public async Task<List<DnsPropagationResult>> QueryAsync(String domain, DnsRecordType recordType, IEnumerable<PublicDnsEntry> servers, CancellationToken cancellationToken = null, IProgress<Double> progress = null, Int32 maxParallelism = 0, Boolean includeGeo = false) #
Returns: Task<List<DnsPropagationResult>>

Asynchronously queries each provided server for the specified domain and record type.

Parameters

domain System.String requiredposition: 0
Domain name to query.
recordType DnsClientX.DnsRecordType requiredposition: 1
DNS record type.
servers System.Collections.Generic.IEnumerable{DomainDetective.PublicDnsEntry} requiredposition: 2
Servers to query.
cancellationToken System.Threading.CancellationToken = null optionalposition: 3
Token used to cancel the operation.
progress System.IProgress{System.Double} = null optionalposition: 4
Optional progress reporter (0..100).
maxParallelism System.Int32 = 0 optionalposition: 5
Maximum concurrent queries (0 uses number of servers).
includeGeo System.Boolean = false optionalposition: 6
When true, performs GeoIP lookups for returned IPs.

Returns

A list of query results.

public Void RemoveServer(String ipAddress) #
Returns: Void

Removes a DNS server from the list using its IP address.

Parameters

ipAddress System.String requiredposition: 0
IP address of the server.
public Void SaveSnapshot(String domain, DnsRecordType recordType, IEnumerable<DnsPropagationResult> results) #
Returns: Void

Saves the provided results to a timestamped snapshot file.

Parameters

domain System.String requiredposition: 0
Queried domain name.
recordType DnsClientX.DnsRecordType requiredposition: 1
DNS record type.
results System.Collections.Generic.IEnumerable{DomainDetective.DnsPropagationResult} requiredposition: 2
Results to persist.
public List<PublicDnsEntry> SelectServers(Dictionary<String, Int32> countryCounts) #
Returns: List<PublicDnsEntry>

Selects a combined list of servers from multiple countries.

Parameters

countryCounts System.Collections.Generic.Dictionary{System.String,System.Int32} requiredposition: 0
Dictionary mapping country code or name to the number of servers to take.

Returns

List of selected servers.

Examples

Select two servers from Poland and one from Germany.


var servers = analysis.SelectServers(new Dictionary<string, int> { ["PL"] = 2, ["DE"] = 1 });
            
public async Task ValidateServerAsnsAsync(InternalLogger logger = null, CancellationToken ct = null) #
Returns: Task

Validates server asns async.

Parameters

logger DomainDetective.InternalLogger = null optionalposition: 0
ct System.Threading.CancellationToken = null optionalposition: 1

Properties

public IReadOnlyList<PublicDnsEntry> Servers { get; } #

Gets the collection of configured DNS servers.

DnsQueryOverride #

Override DNS queries for testing.

GeoLookupOverride #

Override geolocation lookup for testing.

BgpLookupOverride #

Override BGP lookup for testing.

public GeoIpAnalysis GeoIp { get; } #

GeoIP database used for lookups.

public String SnapshotDirectory { get; set; } #

Directory used to store snapshot files.

Fields

_rnd #

Thread-safe random number generator used for selecting a subset of servers.

{{ include "footer" }}