/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that gets the host name. */
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

int main() {
    struct hostent *host;
    char *addr = "169.237.108.51";
    struct in_addr in;
    
    in.s_addr = inet_addr(addr);

    host = gethostbyaddr((char*)&in,sizeof(in),AF_INET);
    printf("%s\n",host->h_name); 
    printf("%d\n",host->h_length);
    printf("%u\n",host->h_addr_list[0]);
}
