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

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit

blog comments powered by Disqus