getaddrinfo() call does not return both IPv6 and IPv4 addresses if nscd is used, unless cache is invalidated manually

Solution Verified - Updated -

Issue

  • Name service caching problem(s)
  • On both RHEL 6.2 and 6.4, nscd fails to read or return more than one address family from /etc/hosts upon initialisation/population of its database.
  • As an example, stop nscd, clear out its DB, start it and then run a getaddrinfo() call for AF_UNSPEC for localhost. This should return both 127.0.0.1 and ::1 but you only get 127.0.0.1.
  • Invalidate the cache with "nscd -i hosts" and try the getaddrinfo() call again, now you get both addresses.
  • Potentially related BZ, 576801.

Environment

  • Red Hat Enterprise Linux 6.2
  • Red Hat Enterprise Linux 6.4
  • Red Hat Enterprise Linux 6.5
  • nscd-2.12-1.47.el6.x86_64
  • nscd-2.12-1.107.el6.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.