title: using getaddrinfo() only checks nscd cache first time if DNS times out
body: <p>If I get an initial "Name or service not known" (EAI_NONAME), the next call to getaddrinfo() seems to go straight to the dns instead of checking the cache first (nscd logs show no lookup attempts, tcpdump shows traffic to DNS server). If the first call succeeds in getting an address, from then on, all getaddrinfo() calls go to nscd first, as expected.</p>
  
  <p>I'm compiling against glibc-2.13 for arm linux. In my rc.d, nscd is started before my daemon. nscd is set to disallow shared caches, and maintain a host cache. I am using the nscd from busybox (0.47). nsswitch.conf is set so host checks cache/files/dns. hosts.conf is set to check files/bind.</p>
  
  <p>My daemon is calling getaddrinfo().</p>
  
  <p>I have debug logs for nscd running, and they show that the client started to read the DNS response closes with a "Broken Pipe" error. </p>
  
  <p>After that it will show GAI attempts from other daemons attempting to use the cache (so I know it's not nscd locked up or anything), but the daemon that got EAI_NONAME never again contacts nscd to do a cache lookup.</p>
  
  <p>If I restart the daemon, I get the same behaviour, <em>if</em> the first DNS query times out again.</p>
  
  <p>Is there something in glibc that is invalidating my daemon's link to the cache? Is there a way to reconnect my daemon to the cache without restarting it (similar to forcing a resolv.conf re-load via res_init())?</p>