getaddrinfo() returning a different name to what is specified in /etc/hosts
Issue
getaddrinfo()behaviour forAF_INETandAF_INET6addresses 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.131or later. - A host entry in
/etc/hostsdoes not return the hostname I expect it to. - A hostname in
/etc/hostsreturns the FQDN instead of the shortname.
Environment
- Red Hat Enterprise Linux 6 (all architectures)
- The
glibcpackage prior toglibc-2.12-1.131.el6installed - This
glibcpackage updated in Red Hat Enterprise Linux 6.5 - Hostnames defined in
/etc/hosts - Application which does lookups using
getaddrinfo()typeAF_INETorAF_INET6lookups of those hostnames.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.