From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,32531913e931a3da X-Google-Attributes: gidfee84,public From: noyd@u.washington.edu (Steve Jones) Subject: Re: gethostbyname Date: 1997/01/02 Message-ID: <5ahhej$o91@nntp1.u.washington.edu>#1/1 X-Deja-AN: 207366020 references: <32CC1643.41C6@watson.ibm.com> supercedes: <5ahgvg$o45@nntp1.u.washington.edu> organization: University of Washington, Seattle nntp-posting-user: noyd newsgroups: comp.unix.osf.osf1 In article <5ahgvg$o45@nntp1.u.washington.edu>, Steve Jones wrote: >In article <32CC1643.41C6@watson.ibm.com>, >Austel Paula K wrote: >>I'm calling gethostbyname in a test program that works on other unix >>systems and fails on dec osf. If I give gethostbyname an ip address >>with dots in it I get HOST_NOT_FOUND. I can ping this ip address >>from my dec machine. Any ideas. >> >>-- >>Paula Sweeney Austel >>IBM Visualization Data Explorer Development >>T.J. Watson Research Center I've having a similar problem with gethostbyname, but with domain names, not IP addresses. #include #include #include main(int argc, char **argv) { struct hostent *ha = 0, *server_host = 0; if (argv[1] == NULL) { fprintf(stderr,"No argument to %s!\n",argv[0]); exit(1); } ha = gethostbyname(argv[1]); server_host = gethostbyaddr(ha->h_addr_list[0],4,AF_INET); if ( server_host ) { fprintf(stderr,"%s\n",server_host->h_name); exit(0); } else { exit(1); } } Running this program: ./a.out 140.142.83.2 saul4.u.washington.edu ./a.out saul4.u.washington.edu (no output) If I modify the hosts entry in the /etc/svc.conf file from hosts=local,bind to hosts=bind,local it works correctly. This is a bug I think, any news on a fix? -- -- Steven Jones Computing & Communications 354843, University of Washington E-mail: noyd@u.washington.edu Phone: (206) 543-5852