From: tao_Zhou AT Shanghaigm DOT com X-Lotus-FromDomain: SGM To: djgpp AT delorie DOT com Message-ID: <482568C1.002EF512.00@mercury.shanghaigm.com> Date: Fri, 14 Apr 2000 16:24:51 +0900 Subject: How to use the "gethostbyname" function Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline Reply-To: djgpp AT delorie DOT com In my program, I used the function "gethostbyname" by which we can get the ip address through the hostname. But to my surprise, it dosen't work as i expected. The way i used it is as followed: if((h=gethostbyname(hostname))==NULL) { herror(strerror); printf("%s",strerror); } Everytime when i run the program, it always told me the same message: unknown host. What's up? Who can tell me how to satisfy this awful function to make my program run properly? hungry for your help!