Skip to content

Instantly share code, notes, and snippets.

@careo
Created April 24, 2009 04:20
Show Gist options
  • Select an option

  • Save careo/100935 to your computer and use it in GitHub Desktop.

Select an option

Save careo/100935 to your computer and use it in GitHub Desktop.
require 'resolv'
hostname = "google.com"
puts hostname + ":"
resolvr = Resolv.new
ip = resolvr.getaddress hostname
puts " ip: #{ip}"
name = resolvr.getname ip
puts " name: #{name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment