From owner-freebsd-hackers Mon Jul 6 09:55:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA09207 for freebsd-hackers-outgoing; Mon, 6 Jul 1998 09:55:51 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA09202 for ; Mon, 6 Jul 1998 09:55:50 -0700 (PDT) (envelope-from tinguely@plains.NoDak.edu) Received: from plains.NoDak.edu (tinguely@plains.NoDak.edu [134.129.111.64]) by freefall.freebsd.org (8.8.8/8.8.5) with ESMTP id JAA17539 for ; Mon, 6 Jul 1998 09:55:33 -0700 (PDT) Received: (from tinguely@localhost) by plains.NoDak.edu (8.8.8/8.8.8) id LAA27539; Mon, 6 Jul 1998 11:55:27 -0500 (CDT) Date: Mon, 6 Jul 1998 11:55:27 -0500 (CDT) From: Mark Tinguely Message-Id: <199807061655.LAA27539@plains.NoDak.edu> To: freebsd-hackers@freefall.cdrom.com, kuku@gilberto.physik.RWTH-Aachen.DE Subject: Re: mit-pthreads and gethostbyname Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I have a strange problem with resolution of localhost (gethostbyname) > when using mit-pthreads where localhost cannot be resolved by > gethostbyname when search order is host->bind in /etc/host.conf > and /etc/resolv.conf is present. using libc_r (which uses the libc gethostby* routines), the host.conf file is used. But using MIT threads like you mentioned, they implement their own gethostby* routines. I think there is a more generic problem MIT pthreads does not consult the /etc/hosts file. I test program that runs on a machine in an isolated network: joy (nameserver) / \ rest of net isolated network the isolated network have /etc/hosts and does a host, bind search order. If i run a program that uses gethostbyname from libc, the correct IP number is returned for joy (the hidden network IP taken from /etc/hosts). test 2, if I resolve a name that has multiple DNS entries, the libc version returns them all. If i run a program that uses gethostbyname from MIT pthreads, the DNS derived IP number is returned for joy. for test 2, only the first IP number of a host that resolves to multiple addresses is returned. check the command, "nslookup localhost", by guess is that it does not have an entry and that is why the MIT pthreads gethostbyname call does not not return a value. --mark. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message