ziegel Posted October 13, 2009 Share Posted October 13, 2009 I am trying to build a script that will show all of the different domains that are hosted on the same ip. However when I do a rdns lookup with php only 1 of the domains is returned. How can I make it return all of the domains? I am trying to build a set of dns sort of tools for developers that use my webspace. I know I could just use curl and go to a site that does this already but I would like to make my own so that I know how it is done. Link to comment https://forums.phpfreaks.com/topic/177603-rdns-with-php/ Share on other sites More sharing options...
jjacquay712 Posted October 13, 2009 Share Posted October 13, 2009 Not sure how you expect us to know the problem when we cant see any code. Link to comment https://forums.phpfreaks.com/topic/177603-rdns-with-php/#findComment-936461 Share on other sites More sharing options...
ziegel Posted October 14, 2009 Author Share Posted October 14, 2009 Well... gethostbyaddr() or another piece of code I was pointed to while trying to search for my answer: function getRdnsRecord($ip) { /* * Validate IP */ if(!ip2long($ip)) { trigger_error("Error: Invalid IP", E_USER_NOTICE); return FALSE; } /* * Break the IP into 4 octets */ $array = explode(".", $ip, 4); /* * Reverse the order of the octets */ $array = array_reverse($array); /* * Assemble our zone */ $zone = implode(".", $array) . ".in-addr.arpa"; /* * Return the Resulting record */ return dns_get_record($zone, DNS_PTR); } Link to comment https://forums.phpfreaks.com/topic/177603-rdns-with-php/#findComment-936467 Share on other sites More sharing options...
ziegel Posted October 15, 2009 Author Share Posted October 15, 2009 bump Link to comment https://forums.phpfreaks.com/topic/177603-rdns-with-php/#findComment-937259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.