5 /* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
6 /* For copying and distribution information, please see the file */
7 /* <mit-copyright.h>. */
10 static char *rcsid_hostname_c = "$Header$";
13 /* PrincipalHostname, borrowed from rcmd.c in Kerberos code */
14 #include <mit-copyright.h>
16 #include <sys/types.h>
17 #include <netinet/in.h>
22 PrincipalHostname(alias)
27 if ((h=gethostbyname(alias)) != (struct hostent *)NULL) {
28 char *p = strchr(h->h_name, '.');
31 p = phost = h->h_name;