Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 366925

Summary: sys-libs/glibc - nscd won't cache DNS results if the hostname resolves to multiple IP addresses
Product: Gentoo Linux Reporter: Charles G Waldman <cgw>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: normal CC: cgw
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Charles G Waldman 2011-05-11 21:57:35 UTC
I am attempting to reponen bug 196241

 I am running glibc-2.13-r2 and confirm the results of the wireshark test described in that bug report.

 For names which resolve to a single IP (www.gentoo.org) the DNS result is cached by nscd and subsequent lookups do not trigger a request to the DNS server.  But for names which resolve to multiple IPs (www.google.com) the nscd does not cache results, and every access results in another hit on the DNS server, which somewhat limits the usefulness of nscd.

Reproducible: Always
Comment 1 Charles G Waldman 2011-05-11 22:18:52 UTC
Looking into this a bit deeper, I suppose it is working as designed.  I find the following comment in glibc-2.13/nscd/hstcache.c 

 /* If the record contains more than one IP address (used for
         load balancing etc) don't cache the entry.  This is something
         the current cache handling cannot handle and it is more than
         questionable whether it is worthwhile complicating the cache
         handling just for handling such a special case. */
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2011-05-13 00:21:38 UTC

*** This bug has been marked as a duplicate of bug 196241 ***