Domain Detective

API Reference

Class

DNSBLAnalysis

Namespace DomainDetective
Assembly DomainDetective
Implements

Provides IP based block list functionality.

Inheritance

  • Object
  • DNSBLAnalysis

Remarks

Both IP- and domain-based blacklists are supported. Results include detailed reply codes for further interpretation.

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

public DNSBLAnalysis(DnsConfiguration dnsConfiguration = null) #

Initializes a new instance of the DNSBLAnalysis class.

Parameters

dnsConfiguration DomainDetective.DnsConfiguration = null optionalposition: 0

Methods

AddDNSBL 2 overloads
public Void AddDNSBL(String dnsbl, Boolean enabled = true, String comment = null, Int32 port = 53) #
Returns: Void

Adds a DNSBL provider to the internal list if not already present.

Parameters

dnsbl System.String requiredposition: 0
Blacklist host name.
enabled System.Boolean = true optionalposition: 1
Whether the entry should be queried.
comment System.String = null optionalposition: 2
Optional descriptive comment.
port System.Int32 = 53 optionalposition: 3
DNS port used when querying.
public Void AddDNSBL(IEnumerable<String> dnsbls) #
Returns: Void

Adds multiple DNSBL providers.

Parameters

dnsbls System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
Collection of DNSBL host names.
public IAsyncEnumerable<DNSBLRecord> AnalyzeDNSBLRecords(String ipAddressOrHostname, InternalLogger logger) #
Returns: IAsyncEnumerable<DNSBLRecord>

Queries the configured DNSBL providers for the specified host or IP address.

Parameters

ipAddressOrHostname System.String requiredposition: 0
Address or hostname to query.
logger DomainDetective.InternalLogger requiredposition: 1
Logger for verbose output.

Returns

Enumeration of DNSBLRecord objects.

public async Task AnalyzeDNSBLRecordsMany(IEnumerable<String> ipAddressesOrHostnames, InternalLogger logger, Boolean clearExisting = true) #
Returns: Task

Queries DNSBL providers for multiple hosts/IPs in parallel and aggregates results.

Parameters

ipAddressesOrHostnames System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
Addresses or hostnames to query.
logger DomainDetective.InternalLogger requiredposition: 1
Logger for verbose output.
clearExisting System.Boolean = true optionalposition: 2
Whether to clear accumulated results before adding.
public IAsyncEnumerable<DNSBLRecord> AnalyzeDomainBlocklists(String domain, InternalLogger logger) #
Returns: IAsyncEnumerable<DNSBLRecord>

Queries all configured domain block lists for the specified domain.

Parameters

domain System.String requiredposition: 0
Domain name to test.
logger DomainDetective.InternalLogger requiredposition: 1
Instance used to log progress.

Returns

Enumerable of individual DNSBL records.

public async Task AnalyzeDomainBlocklistsMany(IEnumerable<String> domains, InternalLogger logger, Boolean clearExisting = true) #
Returns: Task

Queries domain block lists for multiple domains in parallel and aggregates results.

Parameters

domains System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
Domain names to test.
logger DomainDetective.InternalLogger requiredposition: 1
Instance used to log progress.
clearExisting System.Boolean = true optionalposition: 2
Whether to clear previous results.
public Void ClearDNSBL() #
Returns: Void

Clears all configured DNSBL providers.

public IReadOnlyList<DnsblEntry> GetDNSBL() #
Returns: IReadOnlyList<DnsblEntry>

Gets a read only view of configured DNSBL providers.

public IReadOnlyList<BlockListEntry> GetIpBlockLists() #
Returns: IReadOnlyList<BlockListEntry>

Returns configured IP block lists.

public async Task<Boolean> IsDomainListedAsync(String domain, InternalLogger logger) #
Returns: Task<Boolean>

Determines whether the domain appears on any configured domain block list.

Parameters

domain System.String requiredposition: 0
Domain name to test.
logger DomainDetective.InternalLogger requiredposition: 1
Instance used to log progress.

Returns

true if the domain is listed; otherwise false.

public Void LoadDNSBL(String filePath, Boolean clearExisting = false) #
Returns: Void

Loads DNSBL entries from a simple text file.

Parameters

filePath System.String requiredposition: 0
File containing provider domains.
clearExisting System.Boolean = false optionalposition: 1
When set to true existing entries are removed before loading.
public Void LoadDnsblConfig(String filePath, Boolean overwriteExisting = false, Boolean clearExisting = false) #
Returns: Void

Loads DNSBL configuration from a JSON file.

Parameters

filePath System.String requiredposition: 0
Path to JSON configuration file.
overwriteExisting System.Boolean = false optionalposition: 1
Replace existing entries if they already exist.
clearExisting System.Boolean = false optionalposition: 2
Remove existing entries before loading.
public IEnumerable<String> QueryIpBlockLists(IPAddress address) #
Returns: IEnumerable<String>

Determines which lists contain the address.

Parameters

address System.Net.IPAddress requiredposition: 0
public Void RemoveDNSBL(String dnsbl) #
Returns: Void

Removes a DNSBL provider from the list if it exists.

Parameters

dnsbl System.String requiredposition: 0
Blacklist host name.
public Void Reset() #
Returns: Void

Clears cached results allowing the instance to be reused.

public async Task UpdateDnsblDataAsync(String url = "https://raw.githubusercontent.com/EvotecIT/DomainDetective/master/Data/dnsbl.json", Boolean overwriteExisting = true) #
Returns: Task

Executes the update dnsbl data async operation.

Parameters

url System.String = "https://raw.githubusercontent.com/EvotecIT/DomainDetective/master/Data/dnsbl.json" optionalposition: 0
overwriteExisting System.Boolean = true optionalposition: 1

Properties

public String Subject { get; set; } #

Subject for this analysis when domain-scoped; null for multi-input or IP-only runs.

public DnsConfiguration DnsConfiguration { get; set; } #

Gets or sets the dns configuration value.

public Func<String[], DnsRecordType, Task<IEnumerable<DnsResponse>>> QueryDnsFullOverride { get; set; } #

Optional override for DNS queries used for testing.

DnsblEntries #

Gets the collection of configured DNSBL provider entries. Use Int32), String), ClearDNSBL, Boolean) or Boolean) to modify the list.

Value

The DNSBL provider entries.

public Boolean IsBlacklisted { get; } #

Gets a value indicating whether any query returned a listing.

public Int32 RecordChecked { get; } #

Gets the number of hosts or addresses checked.

public Int32 Blacklisted { get; } #

Gets the count of hosts that were listed.

public Int32 NotBlacklisted { get; } #

Gets the count of hosts that were not listed.

public Dictionary<String, DNSQueryResult> Results { get; set; } #

Gets the per-host DNSBL query results.

public List<DNSBLRecord> AllResults { get; set; } #

Gets a flattened list of all DNSBL records returned.

public virtual List<Assessment> Assessments { get; } #

Gets the assessments value.

DomainDNSBLLists #

Gets the list of enabled domain based DNS block lists.

{{ include "footer" }}