Sha256: 2b99b30f47198ec1f5ffa72e7d5de486fadc83ea8a180c9a5502395581294525

Contents?: true

Size: 389 Bytes

Versions: 10

Compression:

Stored size: 389 Bytes

Contents

require 'rubygems' if "#{RUBY_VERSION}" < "1.9.0"
require 'net/dns'

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

10 entries across 10 versions & 2 rubygems

Version Path
net-dns2-0.8.7 demo/threads.rb
net-dns2-0.8.6 demo/threads.rb
net-dns2-0.8.5 demo/threads.rb
net-dns2-0.8.4 demo/threads.rb
net-dns2-0.8.3 demo/threads.rb
net-dns2-0.8.2 demo/threads.rb
net-dns2-0.8.1 demo/threads.rb
net-dns-0.8.0 demo/threads.rb
net-dns-0.7.1 demo/threads.rb
net-dns-0.7.0 demo/threads.rb