C# Класс Heijden.DNS.Resolver

Resolver is the main class to do DNS query lookups
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DefaultDnsServers List

Открытые методы

Метод Описание
BeginGetHostEntry ( IPAddress ip, AsyncCallback requestCallback, object stateObject ) : IAsyncResult

Asynchronously resolves an IP address to an System.Net.IPHostEntry instance.

BeginGetHostEntry ( string hostNameOrAddress, AsyncCallback requestCallback, object stateObject ) : IAsyncResult

Asynchronously resolves a host name or IP address to an System.Net.IPHostEntry instance.

ClearCache ( ) : void

Clear the resolver cache

EndGetHostEntry ( IAsyncResult AsyncResult ) : IPHostEntry

Ends an asynchronous request for DNS information.

GetArpaFromIp ( IPAddress ip ) : string

Translates the IPV4 or IPV6 address into an arpa address

GetDnsServers ( ) : System.Net.IPEndPoint[]

Gets a list of default DNS servers used on the Windows machine.

GetHostEntry ( IPAddress ip ) : IPHostEntry

Resolves an IP address to an System.Net.IPHostEntry instance.

GetHostEntry ( string hostNameOrAddress ) : IPHostEntry

Resolves a host name or IP address to an System.Net.IPHostEntry instance.

Query ( string name, DNSQType qtype, QClass qclass, int timeout ) : Heijden.DNS.DNSResponse

Do Query on specified DNS servers

Query ( string name, DNSQType qtype, int timeout ) : Heijden.DNS.DNSResponse

Do an QClass=IN Query on specified DNS servers

Query ( string name, DNSQType qtype, int timeout, List dnsServers ) : Heijden.DNS.DNSResponse
QueryCache ( string name, DNSQType qtype ) : Heijden.DNS.DNSResponse

Do an QClass=IN Query on the previously cached results.

QueryCache ( string name, DNSQType qtype, QClass qclass ) : Heijden.DNS.DNSResponse

Do an QClass=IN Query on the previously cached results.

Resolver ( ) : System

Resolver constructor, using DNS servers specified by Windows

Resolver ( IPAddress ServerIpAddress, int ServerPortNumber ) : System

Constructor of Resolver using DNS server and port specified.

Resolver ( IPEndPoint DnsServers ) : System

Constructor of Resolver using DNS servers specified.

Resolver ( string ServerIpAddress ) : System

Constructor of Resolver using DNS address.

Resolver ( string ServerIpAddress, int ServerPortNumber ) : System

Constructor of Resolver using DNS address and port specified.

Приватные методы

Метод Описание
AddToCache ( Heijden.DNS.DNSResponse response, string questionKey ) : void
GetActiveDNSServer ( ) : IPEndPoint
GetResponse ( Heijden.DNS.DNSRequest request, List dnsServers, int timeout ) : Heijden.DNS.DNSResponse
IncrementTimeoutCount ( IPEndPoint dnsServer ) : void
MakeEntry ( string HostName, int timeout ) : IPHostEntry
ResetTimeoutCount ( IPEndPoint dnsServer ) : void
SearchInCache ( Question question ) : Heijden.DNS.DNSResponse
TcpRequest ( Heijden.DNS.DNSRequest request, List dnsServers, int timeout ) : Heijden.DNS.DNSResponse

UdpRequest ( Heijden.DNS.DNSRequest request, List dnsServers, int timeout ) : Heijden.DNS.DNSResponse

Verbose ( string format ) : void

Описание методов

BeginGetHostEntry() публичный Метод

Asynchronously resolves an IP address to an System.Net.IPHostEntry instance.
public BeginGetHostEntry ( IPAddress ip, AsyncCallback requestCallback, object stateObject ) : IAsyncResult
ip System.Net.IPAddress The IP address to resolve.
requestCallback AsyncCallback /// An System.AsyncCallback delegate that references the method to invoke when /// the operation is complete. ///
stateObject object /// A user-defined object that contains information about the operation. This /// object is passed to the requestCallback delegate when the operation is complete. ///
Результат IAsyncResult

BeginGetHostEntry() публичный Метод

Asynchronously resolves a host name or IP address to an System.Net.IPHostEntry instance.
public BeginGetHostEntry ( string hostNameOrAddress, AsyncCallback requestCallback, object stateObject ) : IAsyncResult
hostNameOrAddress string The host name or IP address to resolve.
requestCallback AsyncCallback /// An System.AsyncCallback delegate that references the method to invoke when /// the operation is complete. ///
stateObject object /// A user-defined object that contains information about the operation. This /// object is passed to the requestCallback delegate when the operation is complete. ///
Результат IAsyncResult

ClearCache() публичный Метод

Clear the resolver cache
public ClearCache ( ) : void
Результат void

EndGetHostEntry() публичный Метод

Ends an asynchronous request for DNS information.
public EndGetHostEntry ( IAsyncResult AsyncResult ) : IPHostEntry
AsyncResult IAsyncResult /// An System.IAsyncResult instance returned by a call to an /// Overload:Heijden.Dns.Resolver.BeginGetHostEntry method. ///
Результат System.Net.IPHostEntry

GetArpaFromIp() публичный статический Метод

Translates the IPV4 or IPV6 address into an arpa address
public static GetArpaFromIp ( IPAddress ip ) : string
ip System.Net.IPAddress IP address to get the arpa address form
Результат string

GetDnsServers() публичный статический Метод

Gets a list of default DNS servers used on the Windows machine.
public static GetDnsServers ( ) : System.Net.IPEndPoint[]
Результат System.Net.IPEndPoint[]

GetHostEntry() публичный Метод

Resolves an IP address to an System.Net.IPHostEntry instance.
public GetHostEntry ( IPAddress ip ) : IPHostEntry
ip System.Net.IPAddress An IP address.
Результат System.Net.IPHostEntry

GetHostEntry() публичный Метод

Resolves a host name or IP address to an System.Net.IPHostEntry instance.
public GetHostEntry ( string hostNameOrAddress ) : IPHostEntry
hostNameOrAddress string The host name or IP address to resolve.
Результат System.Net.IPHostEntry

Query() публичный Метод

Do Query on specified DNS servers
public Query ( string name, DNSQType qtype, QClass qclass, int timeout ) : Heijden.DNS.DNSResponse
name string Name to query
qtype DNSQType Question type
qclass QClass Class type
timeout int Timeout for lookup in seconds.
Результат Heijden.DNS.DNSResponse

Query() публичный Метод

Do an QClass=IN Query on specified DNS servers
public Query ( string name, DNSQType qtype, int timeout ) : Heijden.DNS.DNSResponse
name string Name to query
qtype DNSQType Question type
timeout int Timeout for lookup in seconds.
Результат Heijden.DNS.DNSResponse

Query() публичный Метод

public Query ( string name, DNSQType qtype, int timeout, List dnsServers ) : Heijden.DNS.DNSResponse
name string
qtype DNSQType
timeout int
dnsServers List
Результат Heijden.DNS.DNSResponse

QueryCache() публичный Метод

Do an QClass=IN Query on the previously cached results.
public QueryCache ( string name, DNSQType qtype ) : Heijden.DNS.DNSResponse
name string Name to query
qtype DNSQType Question type
Результат Heijden.DNS.DNSResponse

QueryCache() публичный Метод

Do an QClass=IN Query on the previously cached results.
public QueryCache ( string name, DNSQType qtype, QClass qclass ) : Heijden.DNS.DNSResponse
name string Name to query
qtype DNSQType Question type
qclass QClass
Результат Heijden.DNS.DNSResponse

Resolver() публичный Метод

Resolver constructor, using DNS servers specified by Windows
public Resolver ( ) : System
Результат System

Resolver() публичный Метод

Constructor of Resolver using DNS server and port specified.
public Resolver ( IPAddress ServerIpAddress, int ServerPortNumber ) : System
ServerIpAddress System.Net.IPAddress DNS server to use
ServerPortNumber int DNS port to use
Результат System

Resolver() публичный Метод

Constructor of Resolver using DNS servers specified.
public Resolver ( IPEndPoint DnsServers ) : System
DnsServers System.Net.IPEndPoint Set of DNS servers
Результат System

Resolver() публичный Метод

Constructor of Resolver using DNS address.
public Resolver ( string ServerIpAddress ) : System
ServerIpAddress string DNS server address to use
Результат System

Resolver() публичный Метод

Constructor of Resolver using DNS address and port specified.
public Resolver ( string ServerIpAddress, int ServerPortNumber ) : System
ServerIpAddress string DNS server address to use
ServerPortNumber int DNS port to use
Результат System

Описание свойств

DefaultDnsServers публичное статическое свойство

Gets list of OPENDNS servers
public static List DefaultDnsServers
Результат List