carrerag Posted November 21, 2008 Share Posted November 21, 2008 Does the gethostbyaddr() function actually support IPV6? I'm inclined to believe that it does although, in all my searching today I haven't seen anything that specifically says so. My problem boils down to this: echo gethostbyaddr ( '2001:4860:0:2001::68' ); Which should return one of googles ipv6 servers, instead I get the following logged in my php error log. [21-Nov-2008 18:12:35] PHP Warning: gethostbyaddr() [<a href='function.gethostbyaddr'>function.gethostbyaddr</a>]: Address is not in a.b.c.d form in C:\www\mysite\tests\saved\host.php on line 7 This makes me think the answer is no... it doesn't support IPV6. Can anyone enlighten me further why this function does not work? Am I not using that function properly? It does work ok with an IPV4 address. Thanks, Glen Link to comment https://forums.phpfreaks.com/topic/133706-gethostbyaddr-and-ipv6/ Share on other sites More sharing options...
flyhoney Posted November 21, 2008 Share Posted November 21, 2008 http://us2.php.net/manual/en/function.gethostbyaddr.php#26641 Link to comment https://forums.phpfreaks.com/topic/133706-gethostbyaddr-and-ipv6/#findComment-695826 Share on other sites More sharing options...
carrerag Posted November 21, 2008 Author Share Posted November 21, 2008 Thanks for the response. I had seen that post (one of the reasons I suspected that IPV6 was indeed supported in some way by the function.) However, that post seems to be specific to ip6.int type records (vice ip6.arpa) which are now deprecated. However, some variation of that method may very well be a good workaround if I have no other option, so I appreciate your bringing that post to my attention again. Link to comment https://forums.phpfreaks.com/topic/133706-gethostbyaddr-and-ipv6/#findComment-695891 Share on other sites More sharing options...
carrerag Posted November 22, 2008 Author Share Posted November 22, 2008 This appears to be a problem with PHP 5.2, I tested PHP 5.3alpha and the function works as it is supposed to. Unfortunately 5.3 raises other issues so I can't use it. Thanks for reading and responding. Glen Link to comment https://forums.phpfreaks.com/topic/133706-gethostbyaddr-and-ipv6/#findComment-696211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.