[comp.unix.programmer] gethostent

avalon@coombs.anu.edu.au (Darren Reed) (06/18/91)

When using the gethostent() function call and its related calls,
it doesnt seem to return any aliases in haliases even though,
according to nslookup the hostname in question has an alias.
the code follows :

		a = inet_addr(s);
		host = gethostbyaddr(&a, sizeof(a), AF_INET);

Am i doing something wrong here ?

I have also tried to use getnetbyaddr() in much the same manner as the
above call to gethostbyaddr(), but getnetbyaddr() or getnetbyname()
only ever seem to return a NULL pointer.
ie:
		a = inet_network(s);
		net = getnetbyaddr(&a, sizeof(a), AF_INET);

will return net as a NULL pointer.

thanks,
-avalon