hostname -i command gives error Hostname lookup failure for IPv6 address on rhel6

here is how the /etc/hosts looks like

127.0.0.1  localhost.localdomain localhost
::1        localhost6.localdomain6 localhost6
2001:fe80:db2:1950:baac:6fff:fe12:5552  rhel6
link|improve this question
Doesn't look like but Have you changed hostname? In that case a reboot is needed. – 0xc0de Jan 11 at 12:10
And what is the output of running hostname without any arguments ? – nos Jan 11 at 12:19
1) No I have not changed the hostname. This is the hostname which i gave when installing rhel6 – Jitendra P Jan 11 at 13:36
hostname command gives the result "rhel6" – Jitendra P Jan 11 at 13:37
When i changed the /etc/hosts file to include ipv4 address instead of 2001:fe80:db2:1950:baac:6fff:fe12:5552 the "hostname -i" and "hostname -f" commands did work. So my doubt is the net-tools-1.60-102.el6.x86_64 rpm does not support it which contains the /bin/hostname – Jitendra P Jan 11 at 13:40
feedback

migrated from stackoverflow.com Jan 13 at 6:08

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown