class Durian::Resolver

Defined in:

durian/resolver.cr
durian/resolver/fetch_list.cr
durian/resolver/pending_list.cr
durian/resolver/server.cr

Constant Summary

IPAddressRecordFlags = [RecordFlag::A, RecordFlag::AAAA]

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(dnsServers : Array(Server)) #

[View source]
def self.new(dns_server : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP) #

[View source]

Class Method Detail

def self.fetch_ip_cache(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil) #

[View source]
def self.from_cloudflare(host : String, port : Int32, resolver : Resolver) : Tuple(UInt64, Array(Socket::IPAddress)) | Nil #

[View source]
def self.get_tcp_socket!(host : String, port : Int32, resolver : Resolver, connect_timeout : Int | Float | Nil = nil) : ::TCPSocket #

[View source]
def self.get_udp_socket!(host : String, port : Int32, resolver : Resolver, connect_timeout : Int | Float | Nil = nil) : UDPSocket #

[View source]
def self.getaddrinfo!(host : String, port : Int32, resolver : Resolver, try_connect : Bool = true) : Tuple(Fetch, Socket::IPAddress) #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, resolver : Resolver, &block : Tuple(Fetch, Array(Socket::IPAddress)) -> ) #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dns_server : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP, tls : Server::TransportLayerSecurity | Nil = nil, &block : FetchList -> ) #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, resolver : Resolver) : FetchList #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dns_server : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP, tls : Server::TransportLayerSecurity | Nil = nil) : FetchList #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dns_server : Array(Server), &block : FetchList -> ) #

[View source]
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dns_server : Array(Server)) : FetchList #

[View source]

Instance Method Detail

def cache_expires?(host, flags : Array(RecordFlag)) #

[View source]
def cloudflare?(host : String, port : Int32 | Nil = 0) : Option::Cloudflare | Nil #

[View source]
def coffee : Coffee::Scanner? #

[View source]
def coffee=(value : Coffee::Scanner) #

[View source]
def dnsServers : Array(Server) #

[View source]
def dnsServers=(dnsServers : Array(Server)) #

[View source]
def fetch_cache(host, flags : Array(RecordFlag), resolve_response : ResolveResponse) #

[View source]
def fetch_record_cache(host, flag : RecordFlag) #

[View source]
def get_socket_protocol(socket : IO) : Protocol | Nil #

[View source]
def getaddrinfoPendingList : PendingList #

[View source]
def getaddrinfoPendingList=(getaddrinfoPendingList : PendingList) #

[View source]
def ip_cache : Durian::Cache::IPAddress? #

[View source]
def ip_cache=(value : Cache::IPAddress) #

[View source]
def mapping?(host : String, port : Int32 | Nil = 0) : Option::Mapping | Nil #

[View source]
def mapping_local?(item, port : Int32 = 0) : Array(Socket::IPAddress) | Nil #

[View source]
def mapping_to?(item, port : Int32 = 0) : Tuple(String, Int32) | Nil #

[View source]
def mismatch_retry #

[View source]
def mutex : Mutex #

[View source]
def mutex=(mutex : Mutex) #

[View source]
def option : Option #

[View source]
def option=(option : Option) #

[View source]
def pending_getaddrinfo_fetch(host : String, port : Int32, resolver : Resolver) : Nil #

[View source]
def query_record!(specify : Array(Server) | Nil, host : String, flag : RecordFlag, strict_answer : Bool = false) : Array(Packet) | Nil #

[View source]
def query_record!(socket : IO | Nil, host : String, flag : RecordFlag, strict_answer : Bool = false) : Packet | Nil #

[View source]
def record_cache : Durian::Cache::Record? #

[View source]
def record_cache=(value : Cache::Record) #

[View source]
def resolve(host, flag : RecordFlag, strict_answer : Bool = false, &callback : ResolveResponse -> ) #

[View source]
def resolve(host, flags : Array(RecordFlag), strict_answer : Bool = false, &callback : ResolveResponse -> ) #

[View source]
def resolve_task(specify : Array(Server) | Nil, host : String, task : ResolveTask) #

[View source]
def run #

[View source]
def set_record_cache(host, packets : Array(Packet), flag : RecordFlag) #

[View source]
def set_record_cache(host, packet : Packet, flag : RecordFlag) #

[View source]
def specify?(host : String, port : Int32 | Nil = 0) : Option::Specify | Nil #

[View source]
def tasks : Hash(String, Hash(String, ResolveTask)) #

[View source]
def tasks=(tasks : Hash(String, Hash(String, ResolveTask))) #

[View source]
def to_ip_address(host : String) #

[View source]