Bug 1015851
Summary: | gethostbyname failed to retrieve IPv6 address in /etc/hosts | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | wzis |
Component: | glibc | Assignee: | glibc team <glibc-bugzilla> |
Status: | CLOSED WORKSFORME | QA Contact: | qe-baseos-tools-bugs |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.4 | CC: | ashankar, codonell, fweimer, mnewsome, pfrankli, wzis |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-11-08 10:43:28 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
wzis
2013-10-06 07:45:26 UTC
only after add "options inet6", now it works. But then the IPv4 address in /etc/hosts fail to work. This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. Moving to rhel-6.6 for scoping. (In reply to wzis from comment #0) > Description of problem: the IPv6 address put in /etc/hosts with a special > and unique name for it doesn't get returned by gethostbyname using that name. gethostbyname only returns IPv4 addresses, by design. Please provide more details what you are doing. "gethostbyname only returns IPv4 addresses"? then why after adding "options inet6" to resolve.conf, it can return IPv6 address? Also the man page says "The gethostbyname() function returns a structure of type hostent for the given host name. Here name is either a hostname, or an IPv4 address in standard dot notation (as for inet_addr(3)), or an IPv6 address in colon (and possibly dot) notation." The gethostbyname does handle IPv6 address. So why without using the options, it can't return the IPv6 addr specified in the /etc/hosts? I cannot reproduce this issue with glibc-2.12-1.209.el6.x86_64. With “options inet6”, gethostbyname returns IPv6 addresses mapped IPv4, as expected. Note that “options inet6” has been deprecated in upstream glibc. |