# FIRST EXAMPLE require 'rubygems' require '../lib/whois' w = Whois::Whois.new '72.14.207.99' w.search_whois # All return of request w.all # The ip return with object IPAddr w.ip # The server where the request has send w.server # The host of this IPv4 w.host # SECOND EXAMPLE require 'ipaddr' ip = IPAddr.new '72.17.207.99' w = Whois::Whois.new ip w.search_whois # All return of request w.all # The ip return with object IPAddr w.ip # The server where the request has send w.server # The host of this IPv4 w.host # THIRD EXAMPLE w = Whois::Whois.new '72.14.221.147', true w.search_whois # All return of request w.all # The ip return with object IPAddr w.ip # The server where the request has send w.server # The host of this IPv4 w.host #=> fg-in-f147.google.com # FOUR EXAMPLE w = Whois::Whois.new 'fg-in-f147.google.com' w.search_whois # All return of request w.all # The ip return with object IPAddr w.ip # The server where the request has send w.server # The host of this host w.host #=> fg-in-f147.google.com # FIFTH EXAMPLE w = Whois::Whois.new '2001:0660::' w.search_whois # All return of request w.all # The ip return with object IPAddr w.ip # The server where the request has send w.server # The host of this host w.host #=> fg-in-f147.google.com # SIX EXAMPLE w = Whois::Whois.new(IPAddr.new('2001:0660::')) w.search_whois # All return of request p w.all # The ip return with object IPAddr p w.ip # The server where the request has send p w.server # The host of this host p w.host #=> fg-in-f147.google.com