From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,94fa32bcac4ccbb6 X-Google-Attributes: gidfee84,public From: iglesias@draco.acs.uci.edu (Mike Iglesias) Subject: Re: gethostbyaddr() doesn't find host (Digital Unix V3.2c) Date: 1996/03/14 Message-ID: <4i9m7l$itb@news.service.uci.edu>#1/1 X-Deja-AN: 142637615 references: <826554688.24324.0@fersys.demon.co.uk> organization: University of California, Irvine newsgroups: comp.unix.osf.osf1 In article <826554688.24324.0@fersys.demon.co.uk>, wrote: >I am accepting a socket connection, and trying to ascertain the hostname >of the source. I'm calling inet_ntoa() on the network address >[ inetaddr = inet_ntoa (acc_addr.sin_addr); ] >and then passing the resulting string to gethostbyaddr(), but >the system does not find my host, even though it's in the host file. You're misinterpreting the man page for gethostbyaddr(). You want to pass acc_addr.sin_addr to it rather than the ASCII representation of the IP address. -- Mike Iglesias Internet: iglesias@draco.acs.uci.edu University of California, Irvine phone: (714) 824-6926 Office of Academic Computing FAX: (714) 824-2069