Find out the NameServers of a Domain name

V

Vinay Beckham

Hi guys,
I was wondering if there is any way to find out all the Nameservers a
domain is mapped to.
Example: www.google.com
Name Servers:
ns1.google.com
ns2.google.com
ns3.google.com
ns4.google.com

Is there any way i could do this in Ruby??
 
D

darren kirby

quoth the Vinay Beckham:
Hi guys,
I was wondering if there is any way to find out all the Nameservers a
domain is mapped to.
Example: www.google.com
Name Servers:
ns1.google.com
ns2.google.com
ns3.google.com
ns4.google.com

Is there any way i could do this in Ruby??

Try resolv.rb:

require 'resolv'

a = []
dns = Resolv::DNS.new
dns.getresources("google.com", Resolv::DNS::Resource::IN::NS).collect {|n| a
<< n.name.to_s }
p a
=> ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"]

-d
 
V

Vinay Beckham

darren said:
quoth the Vinay Beckham:
Try resolv.rb:

require 'resolv'

a = []
dns = Resolv::DNS.new
dns.getresources("google.com", Resolv::DNS::Resource::IN::NS).collect
{|n| a
<< n.name.to_s }
p a
=> ["ns1.google.com", "ns2.google.com", "ns3.google.com",
"ns4.google.com"]

-d

Perfect... thnx mate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top