Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 64 lines (50 sloc) 1.212 kb
#!/usr/bin/env ruby
require 'whoaz'
require 'optparse'
OptionParser.new do |opt|
opt.banner = 'Usage: whoaz domain'
opt.separator ''
opt.separator 'Options:'
opt.on_tail('-h', '--help', 'Prints this help message') do
puts opt
exit
end
opt.on_tail('-v', '--version', 'Prints version') do
puts "Whoaz #{Whoaz::VERSION}"
exit
end
begin
opt.parse!
rescue OptionParser::ParseError
puts opt
exit 1
end
if ARGV.size.zero?
puts opt
exit 1
end
end
domain = ARGV.first
begin
query = Whoaz.whois domain
rescue Whoaz::Error => e
abort e.message
end
puts "\nWhoaz Version #{Whoaz::VERSION}\n\n"
if query.free?
puts "Domain #{domain.upcase} is not registered.\n\n"
puts "NOTE: NOT REGISTERED DOMAIN IS NOT INDICATIVE OF THE AVAILABILITY OF A DOMAIN NAME."
exit
end
puts "Domain Name: #{domain.upcase}"
query.nameservers.each do |ns|
puts "Name Server: #{ns.upcase}"
end if query.nameservers
puts "\nRegistrant:"
puts " Organization: #{query.organization}" if query.organization
puts " Name: #{query.name}
Address: #{query.address}
Phone: #{query.phone}
Fax: #{query.fax}
Email: #{query.email}
"
Jump to Line
Something went wrong with that request. Please try again.