#48008 [Opn->Csd]: gethostbyname does not return IPv6 addresses
ID: 48008
Updated by: joey@php.net
Reported By: carsten_sttgt at gmx dot de
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows_NT
PHP Version: 5.2.9
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
gethostbyname and gethostbynamel are now documented as giving the
"IPv4
address"
Previous Comments:
------------------------------------------------------------------------
[2009-04-20 09:30:56] jani@php.net
See also bug #33170
------------------------------------------------------------------------
[2009-04-17 21:10:38] carsten_sttgt at gmx dot de
Description:
------------
Hello,
I have a system e.g.:
hostname: localhost
ip1: ::1
ip2: 127.0.0.1
(the problem is not specific to localhost)
A fopen('http://localhost/', 'rb');
connect correctly to "::1".
But gethostbyname('localhost'); returns "127.0.0.1".
gethostbynamel('localhost'); also returns only a array with
"127.0.0.1".
Well, how can I know which IP PHP is using in a e.g. fopen() call?
And if gethostbyname() can't work with IPv6, this should be noted in
the PHP manual. From what I can see, gethostbyaddr() is also working
only with IPv4 (don't see this in the manual).
In phpinfo() i can read:
| IPv6 Support enabled
Regards,
Carsten
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48008&edit=1
Thread (2 messages)