/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that prints all hostname. */
#include <stdlib.h>
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>

int main() {
    struct hostent *sp;
    
    sethostent(1);
    while((sp = gethostent()) != NULL)
       printf("%s\n",sp->h_name);  
    endhostent();
}
