class DNS::Resolver

Defined in:

dns/resolver.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(config : Config = Config.cloudflare) #

[View source]

Class Method Detail

def self.query(name, record_types : RecordType, record_class = RecordClass::Internet) : Message #

Creates a temporary resolver, sends a query and returns the result. If you are sending more than one query at a time, create your own Resolver instance instead.

DNS::Resolver.query "example.com", RecordType::AAAA

[View source]

Instance Method Detail

def close #

Closes the socket.


[View source]
def query(name, record_type : RecordType, record_class = RecordClass::Internet) : Message #

Sends a query.

resolver = DNS::Resolver.new
pp resolver.query "example.com", RecordType::AAAA
resolver.close

[View source]
def send(message : Message) : Message #

Sends a message and retrieves the result.


[View source]