getaddrinfo() returning a different name to what is specified in /etc/hosts
Issue
getaddrinfo()
behaviour forAF_INET
andAF_INET6
addresses changed as of Red Hat Enterprise Linux 6.5- Different hostname is returned by the
getaddrinfo()
function when using an updatedglibc
. - Name resolution for addresses in hosts file behaves differently in
glibc-2.12-1.131
or later. - A host entry in
/etc/hosts
does not return the hostname I expect it to. - A hostname in
/etc/hosts
returns the FQDN instead of the shortname.
Environment
- Red Hat Enterprise Linux 6 (all architectures)
- The
glibc
package prior toglibc-2.12-1.131.el6
installed - This
glibc
package updated in Red Hat Enterprise Linux 6.5 - Hostnames defined in
/etc/hosts
- Application which does lookups using
getaddrinfo()
typeAF_INET
orAF_INET6
lookups of those hostnames.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.