Sha256: 545ca5b447398577be845ee1ba7b6a4d509b05ac31529e8379e2b32dd6410e7e

Contents?: true

Size: 398 Bytes

Versions: 10

Compression:

Stored size: 398 Bytes

Contents

require 'rubygems' if "#{RUBY_VERSION}" < "1.9.0"
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

10 entries across 10 versions & 2 rubygems

Version Path
bluemonk-net-dns-0.5.0 demo/threads.rb
bluemonk-net-dns-0.5.1 demo/threads.rb
bluemonk-net-dns-0.5.2 demo/threads.rb
bluemonk-net-dns-0.5.3 demo/threads.rb
net-dns-0.6.1 demo/threads.rb
net-dns-0.6.0 demo/threads.rb
net-dns-0.5.3 demo/threads.rb
net-dns-0.5.1 demo/threads.rb
net-dns-0.5.0 demo/threads.rb
net-dns-0.5.2 demo/threads.rb