struct in_addr address; 

address.s_addr = inet_addr(argv[1]); 

host = gethostbyaddr((char *)&address, 4, AF_INET);  //得到主机的相关信息