Getting DNS in Ruby
Posted: April 20th, 2011 | Author: Dax | Filed under: Ruby | No Comments »Here’s a short snippet of how to grab a domain’s nameserver info using Ruby.
require 'resolv'
a = []
dns = Resolv::DNS.new
dns.getresources("google.com", Resolv::DNS::Resource::IN::NS).collect {|n| a << n.name.to_s }
puts a
Leave a Reply