From owner-freebsd-current Fri Feb 7 03:37:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA21255 for current-outgoing; Fri, 7 Feb 1997 03:37:38 -0800 (PST) Received: from alcatel.fr (ns.alcatel.fr [194.133.58.131]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA21238 for ; Fri, 7 Feb 1997 03:37:32 -0800 (PST) Received: from alcatel.fr (gatekeeper-ssn.alcatel.fr [155.132.180.244]) by mailgate.alcatel.fr (8.7.3/8.7.3) with ESMTP id MAA07652; Fri, 7 Feb 1997 12:42:25 +0100 Received: from dnscit.cit.alcatel.fr (dnscit.cit.alcatel.fr [139.54.100.2]) by nsfhh5.alcatel.fr (8.7.3/8.7.3) with SMTP id MAA02109; Fri, 7 Feb 1997 12:37:14 +0100 (MET) Received: from dnsvz.vz.cit.alcatel.fr by dnscit.cit.alcatel.fr (SMI-8.6/SMI-SVR4) id MAA15110; Fri, 7 Feb 1997 12:39:23 +0100 Received: from bcv64s3e.vz.cit.alcatel.fr by dnsvz.vz.cit.alcatel.fr (SMI-8.6/SMI-SVR4) id MAA16226; Fri, 7 Feb 1997 12:23:37 +0100 Received: from bcv64wc1.velizy by bcv64s3e.vz.cit.alcatel.fr (SMI-8.6/SMI-SVR4) id MAA19754; Fri, 7 Feb 1997 12:35:49 +0100 From: luc.lewy@vz.cit.alcatel.fr (Luc.LEWY) Message-Id: <199702071135.MAA19754@bcv64s3e.vz.cit.alcatel.fr> Subject: Re: fetch and gethostbyname To: roberto@eurocontrol.fr (Ollivier Robert) Date: Fri, 7 Feb 1997 12:35:50 +0100 (MET) Cc: freebsd-current@freebsd.org In-Reply-To: <19970207093535.OS29821@caerdonn.eurocontrol.fr> from "Ollivier Robert" at Feb 7, 97 09:35:35 am MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Ollivier Robert wrote: > I am able to resolve atena with all other tools of course. I've got the same problem with ircd 2.9.2 ( It's quite a bit different for me.. As in a config test, I don't have a DNS.. ) If I setup a DNS and use gethostbyname, that's okay.. If I just have NIS entry for hosts, ircd can't resolv its hostname (and idem for all clients comming from the local network) Here, at work, with SunOS 4.1.3, no DNS , only complete NIS maps entry... ircd can't resolv its hostname, neither clients hostname (on the local network) Gethostbyname return an errno > 0 in this configuration, h_errno is set to 0 and gethostbyname() return the correct info from NIS database .. Very often, boggus code check 'errno'.. and not 'h_errno' .. The correct test would be : if ( (hostentry=gethostbyname("foobar")) == NULL) { /* .. test h_errno here.. */ } errno=0; /* delete this boggus return code */ h_errno is define in /usr/include/netdb.h error code too.. fifi...