Jump to content

gethostbyaddr() and IPV6


carrerag

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.