who is

http://blog.csdn.net/trip/article/details/378739

http://blog.csdn.net/xviewee/article/details/1906563

 

 http://jwhoisserver.sourceforge.net/

  代码:

--[[
    whois 的Lua实现
    whois 服务器协议:
        WHOIS协议
        客户端向服务器43端口建议TCP连接
        发送查询IP地址并加上一个回车'\n'字符
        例如: 发送"60.28.14.159\n",服务器即返回该ip的注册信息
    Version: 0.1 by hqwfreefly
--]]
require("socket")
local tcp = socket.tcp()
assert(tcp, "Create TCP master object error")
local WHOIS_SERVER = "wq.apnic.net"
local WHOIS_PORT = 43
if not arg[1] then print("Usage: lua whois.lua [hostname | ipaddress]") os.exit(1) end
local ip = socket.dns.toip(arg[1])
if not ip then print("hostname error") os.exit(1) end
local ret = tcp:connect(WHOIS_SERVER, WHOIS_PORT)
if not ret then print("Unable to connect to whois-server: ", WHOIS_SERVER) os.exit(1) end
tcp:send(ip .. "\n")
local info = tcp:receive("*all")
print(info)
tcp:close()

 

你可能感兴趣的:(who is)