char *c; struct hostent *h;
nrl_domainname (void){  static int first = 1;  if (first) {    char *c;    struct hostent *h;    first = 0;    if ((h = gethostbyname("localhost")) && (c = strchr(h->h_name, '.')))      return strcpy(domain = domainbuffer, ++c);    if (!gethostname(domainbuffer, sizeof(domainbuffer))) {      if (c = strchr(domainbuffer, '.'))        return (domain = ++c);      if ((h = gethostbyname(domainbuffer)) && (c = strchr(h->h_name, '.')))        return strcpy(domain = domainbuffer, ++c);    }    {      struct in_addr in_addr;      in_addr.s_addr = htonl(0x7f000001);      if ((h = gethostbyaddr((const char *)&in_addr, sizeof(struct in_addr), AF_INET)) && (c = strchr(h->h_name, '.')))        return strcpy(domain = domainbuffer, ++c);    }    return NULL;  };  return domain;};