Module: Async::DNS::Endpoint

Defined in:
lib/async/dns/endpoint.rb

Overview

DNS endpoint helpers.

Class Method Summary collapse

Class Method Details

.for(nameservers, port: 53, **options) ⇒ Object

Get a list of standard nameserver connections which can be used for querying any standard servers that the system has been configured with.



11
12
13
14
15
16
17
18
19
20
# File 'lib/async/dns/endpoint.rb', line 11

def self.for(nameservers, port: 53, **options)
	connections = []
	
	Array(nameservers).each do |host|
		connections << IO::Endpoint.udp(host, port, **options)
		connections << IO::Endpoint.tcp(host, port, **options)
	end
	
	return IO::Endpoint.composite(*connections)
end