glibc will never use the value returned from nscd for a gethostbyaddr because it's always too short. There's a fragment in glibc that does... if (__readv( ... ) != total_len ) { __close(socket); return -1; } The problem is that glibc is expecting to get the name, followed by the IPv4 addresses, FOLLOWED BY THE IPv6 addresses!! So glibc is expecting to see 40 bytes typically, but nscd is only every writting the IPv4 address (i.e a total of 24 bytes). glibc is confused, to returns a failure. nscd thus doesn't cache. fun. :( My hack was to have nscd write an extra 60 bytes on each request. (yuck). because glibc is reading the right len, it'll just junk the remainder when it does the close. So it'll use the value. The real fix is either change glibc to not expect the IPv6 addresses if it didn't ask for them, or change nscd to always return a NULL IPv6 address.
assigned to jakub
This has long since been fixed.