Prefer Resolv::DNS to subshell and regexps

Benefits
  * support transparently both IPv6 and IPv4
  * avoid spawning a child process
  * friendlier to all Ruby VMs (especially jruby)
  * less brittle when avoiding regexps