Skip to content

Instantly share code, notes, and snippets.

@gomasy
Created May 4, 2014 12:49
Show Gist options
  • Save gomasy/ed13f2eca00d92a70f99 to your computer and use it in GitHub Desktop.
Save gomasy/ed13f2eca00d92a70f99 to your computer and use it in GitHub Desktop.
require "socket"
def inquiry(host, domain)
whois = ""
socket = TCPSocket.open(host, 43)
socket.puts domain
while socket.gets != nil do
str = socket.gets
whois << str if str != nil
end
socket.close
whois
end
domain_list = [
"axer.ga",
"goma.ga",
"manuke.ga",
"kubi.ga"
]
domain_list.each do |e|
suspended = false
str = inquiry("whois.dot.ga", e)
if str.include?("suspended")
suspended = true
end
puts suspended
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment