Sha256: 4fd6b619c567ce12e96cc9f2e9c03fbee534a83d1ca623845bf3374bdb7e83db
Contents?: true
Size: 348 Bytes
Versions: 5
Compression:
Stored size: 348 Bytes
Contents
require 'net/dns/resolver' a = ["ibm.com", "sun.com", "redhat.com"] threads = [] for dom in a threads << Thread.new(dom) do |domain| res = Net::DNS::Resolver.new res.query(domain, Net::DNS::NS).each_nameserver do |ns| puts "Domain #{domain} has nameserver #{ns}" end puts "" end end threads.each do |t| t.join end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
net-dns-0.2.5 | demo/threads.rb |
net-dns-0.3 | demo/threads.rb |
net-dns-0.1 | demo/threads.rb |
net-dns-0.2 | demo/threads.rb |
net-dns-0.4 | demo/threads.rb |