怎样把ip转换为域名呀。如:101.10.1.1 转换为 www.aaa.com。
最好能给具体的函数,这样小弟我也好去查msdn
谢谢

解决方案 »

  1.   

    struct hostent * gethostbyaddr(
    const char *addr, 
    int len, 
    int type );
      

  2.   

    gethostbyaddr
    This function retrieves the host data corresponding to a network address. struct hostent * gethostbyaddr(
    const char *addr, 
    int len, 
    int type );
    Parameters
    addr 
    [in] Pointer to an address in network byte order. 
    len 
    [in] Address length. 
    type 
    [in] Address type. 
    Return Values
    A pointer to the HOSTENT structure indicates no error occurred. A NULL pointer indicates failure. To get a specific error value, call the WSAGetLastError function.Res
    The gethostbyaddr function returns a pointer to the HOSTENT structure that contains the name and address corresponding to the given network address. All strings are null-terminated.