API Reference
DNSBLAnalysis
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
- Property DomainHealthCheck.DNSBLAnalysis
- Property DnsblInfo.Raw
Accepted by parameters
- Method DnsblNarrative.Build
- Method Converters.Convert
Constructors
public DNSBLAnalysis(DnsConfiguration dnsConfiguration = null) #Initializes a new instance of the DNSBLAnalysis class.
Parameters
- dnsConfiguration DomainDetective.DnsConfiguration = null
Methods
public Void AddDNSBL(String dnsbl, Boolean enabled = true, String comment = null, Int32 port = 53) #VoidAdds a DNSBL provider to the internal list if not already present.
Parameters
- dnsbl System.String
- Blacklist host name.
- enabled System.Boolean = true
- Whether the entry should be queried.
- comment System.String = null
- Optional descriptive comment.
- port System.Int32 = 53
- DNS port used when querying.
public Void AddDNSBL(IEnumerable<String> dnsbls) #VoidAdds multiple DNSBL providers.
Parameters
- dnsbls System.Collections.Generic.IEnumerable{System.String}
- Collection of DNSBL host names.
public IAsyncEnumerable<DNSBLRecord> AnalyzeDNSBLRecords(String ipAddressOrHostname, InternalLogger logger) #IAsyncEnumerable<DNSBLRecord>Queries the configured DNSBL providers for the specified host or IP address.
Parameters
- ipAddressOrHostname System.String
- Address or hostname to query.
- logger DomainDetective.InternalLogger
- Logger for verbose output.
Returns
Enumeration of DNSBLRecord objects.
public async Task AnalyzeDNSBLRecordsMany(IEnumerable<String> ipAddressesOrHostnames, InternalLogger logger, Boolean clearExisting = true) #TaskQueries DNSBL providers for multiple hosts/IPs in parallel and aggregates results.
Parameters
- ipAddressesOrHostnames System.Collections.Generic.IEnumerable{System.String}
- Addresses or hostnames to query.
- logger DomainDetective.InternalLogger
- Logger for verbose output.
- clearExisting System.Boolean = true
- Whether to clear accumulated results before adding.
public IAsyncEnumerable<DNSBLRecord> AnalyzeDomainBlocklists(String domain, InternalLogger logger) #IAsyncEnumerable<DNSBLRecord>Queries all configured domain block lists for the specified domain.
Parameters
- domain System.String
- Domain name to test.
- logger DomainDetective.InternalLogger
- Instance used to log progress.
Returns
Enumerable of individual DNSBL records.
public async Task AnalyzeDomainBlocklistsMany(IEnumerable<String> domains, InternalLogger logger, Boolean clearExisting = true) #TaskQueries domain block lists for multiple domains in parallel and aggregates results.
Parameters
- domains System.Collections.Generic.IEnumerable{System.String}
- Domain names to test.
- logger DomainDetective.InternalLogger
- Instance used to log progress.
- clearExisting System.Boolean = true
- Whether to clear previous results.
public IReadOnlyList<DnsblEntry> GetDNSBL() #IReadOnlyList<DnsblEntry>Gets a read only view of configured DNSBL providers.
public IReadOnlyList<BlockListEntry> GetIpBlockLists() #IReadOnlyList<BlockListEntry>Returns configured IP block lists.
public async Task<Boolean> IsDomainListedAsync(String domain, InternalLogger logger) #Task<Boolean>Determines whether the domain appears on any configured domain block list.
Parameters
- domain System.String
- Domain name to test.
- logger DomainDetective.InternalLogger
- Instance used to log progress.
Returns
true if the domain is listed; otherwise false.
public Void LoadDNSBL(String filePath, Boolean clearExisting = false) #VoidLoads DNSBL entries from a simple text file.
Parameters
- filePath System.String
- File containing provider domains.
- clearExisting System.Boolean = false
- When set to true existing entries are removed before loading.
public Void LoadDnsblConfig(String filePath, Boolean overwriteExisting = false, Boolean clearExisting = false) #VoidLoads DNSBL configuration from a JSON file.
Parameters
- filePath System.String
- Path to JSON configuration file.
- overwriteExisting System.Boolean = false
- Replace existing entries if they already exist.
- clearExisting System.Boolean = false
- Remove existing entries before loading.
public IEnumerable<String> QueryIpBlockLists(IPAddress address) #IEnumerable<String>Determines which lists contain the address.
Parameters
- address System.Net.IPAddress
public Void RemoveDNSBL(String dnsbl) #VoidRemoves a DNSBL provider from the list if it exists.
Parameters
- dnsbl System.String
- Blacklist host name.
public async Task UpdateDnsblDataAsync(String url = "https://raw.githubusercontent.com/EvotecIT/DomainDetective/master/Data/dnsbl.json", Boolean overwriteExisting = true) #TaskExecutes the update dnsbl data async operation.
Parameters
- url System.String = "https://raw.githubusercontent.com/EvotecIT/DomainDetective/master/Data/dnsbl.json"
- overwriteExisting System.Boolean = true
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.