Last Modified
2016-08-02 18:20:40 -0500
  • socket
  • fcntl
  • timeout
  • thread
  • securerandom
  • win32/resolv
  • win32/resolv


resolv library

resolv.rb is a resolver library written in Ruby. Since it is written in Ruby, it is thread-aware. I.e. it can resolv many hostnames concurrently.

It is possible to lookup various resources of DNS using DNS module directly.


p Resolv.getaddress("")
p Resolv.getname("") {|dns|
  p dns.getresources("", Resolv::DNS::Resource::IN::A).collect {|r| r.address}
  p dns.getresources("", Resolv::DNS::Resource::IN::MX).collect {|r| [, r.preference]}

Resolv class

class methods