This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [bug] nss resolver code doesn't stop at files lookup

On Sat, Nov 11, 2000 at 07:24:11AM +0100, Thorsten Kukuk wrote:
> Hi,
> On Fri, Nov 10, Ben Collins wrote:
> > This is pretty easy to reproduce. Basically what happens (and can be seen
> > from an strace) is that that with getaddrinfo(), a success on a /etc/hosts
> > lookup does not stop the NSS lookup process, and it continues to try and
> > find it via DNS.
> You forget to say one important thing: glibc tries to get the IPv6 address
> over DNS.

Uggh. Anyway to prevent this, or is it merely an extension/feature of

> > hosts:
> >	localhost
> Add the following:
> # special IPv6 addresses
> ::1             localhost ipv6-localhost ipv6-loopback

That worked.

> > Now, if you do a name lookup for `localhost' under these conditions, I
> > would expect that it would not attempt a DNS lookup. This is not the case
> > with getaddrinfo(), but it is the case with gethostbyname().
> I would expect a DNS lookup, since you have not specified the IPv6 address
> in /etc/hosts.
> SuSE solves this problem for a long time with a second libnss_dns Module.
> Our standard libnss_dns Module does not make lookups for IPv6 addresses.
> > getaddrinfo() continues to do a DNS lookup, even after it has read and
> > parsed /etc/hosts. Now this would not be a major problem, if it did not
> > cause the call to getaddrinfo to fail and return non-zero. IOW, any DNS
> > failure (other than notfound) for a host in /etc/hosts, will cause a
> > failure for the getaddrinfo call completely.
> Strange, I never saw this. This sounds like a real bug.

Yeah, this is the biggest problem. The others wouln't matter so much if
things didn't fail like they are.

/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  --  --  '

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]