Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 1998 11:55:27 -0500 (CDT)
From:      Mark Tinguely <tinguely@plains.NoDak.edu>
To:        freebsd-hackers@freefall.cdrom.com, kuku@gilberto.physik.RWTH-Aachen.DE
Subject:   Re: mit-pthreads and gethostbyname
Message-ID:  <199807061655.LAA27539@plains.NoDak.edu>

next in thread | raw e-mail | index | archive | help
>  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807061655.LAA27539>