#include #include #include #include #include #include #define COUNT 100000 int main(void) { int i; struct in_addr addr; struct hostent *hp; addr.s_addr = htonl(INADDR_LOOPBACK); for (i = 0; i < COUNT; i++) { hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET); if (hp) printf("%d: %s = %s\n", i, inet_ntoa(addr), hp->h_name); else printf("%d: Resolving failed\n", i); } return 0; }