Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created February 28, 2010 18:09
Show Gist options
  • Save fapestniegd/317705 to your computer and use it in GitHub Desktop.
Save fapestniegd/317705 to your computer and use it in GitHub Desktop.
whitejs@loki:~$ ruby -rresolv -e 'res = Resolv::DNS::new; p res.getaddress("websages.com").to_s'
"65.19.178.149"
whitejs@loki:~$ ruby -rresolv -e 'res = Resolv::DNS::new( { "nameserver" => [ "65.19.178.106" ] } ); p res.getaddress("websages.com").to_s'
/usr/lib/ruby/1.8/resolv.rb:702:in `recv': Connection refused - recvfrom(2) (Errno::ECONNREFUSED)
from /usr/lib/ruby/1.8/resolv.rb:702:in `recv_reply'
from /usr/lib/ruby/1.8/resolv.rb:618:in `request'
from /usr/lib/ruby/1.8/resolv.rb:489:in `each_resource'
from /usr/lib/ruby/1.8/resolv.rb:938:in `resolv'
from /usr/lib/ruby/1.8/resolv.rb:936:in `each'
from /usr/lib/ruby/1.8/resolv.rb:936:in `resolv'
from /usr/lib/ruby/1.8/resolv.rb:935:in `each'
from /usr/lib/ruby/1.8/resolv.rb:935:in `resolv'
from /usr/lib/ruby/1.8/resolv.rb:933:in `each'
from /usr/lib/ruby/1.8/resolv.rb:933:in `resolv'
from /usr/lib/ruby/1.8/resolv.rb:481:in `each_resource'
from /usr/lib/ruby/1.8/resolv.rb:386:in `each_address'
from /usr/lib/ruby/1.8/resolv.rb:362:in `getaddress'
from -e:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment