#48008 [Opn]: gethostbyname does not return IPv6 addresses

From: Date: Mon, 20 Apr 2009 09:30:57 +0000
Subject: #48008 [Opn]: gethostbyname does not return IPv6 addresses
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2114@lists.php.net to get a copy of this message
 ID:               48008
 Updated by:       jani@php.net
 Reported By:      carsten_sttgt at gmx dot de
 Status:           Open
-Bug Type:         Network related
+Bug Type:         Documentation problem
 Operating System: Windows_NT
 PHP Version:      5.2.9
 New Comment:

See also bug #33170


Previous Comments:
------------------------------------------------------------------------

[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)

« previous php.doc.bugs (#2114) next »