daq Posted December 7, 2007 Share Posted December 7, 2007 I searched the forum and found nothing. echo checkdnsrr($ip) ? 'True' : 'False'; returns false no matter what $ip is. The function does work correctly when I feed it the name, but ip address consistently fails. Anyone dealt with this before? Any suggestions other than using exec(host) || exec(nslookup) welcome. :-) Thank you. Link to comment https://forums.phpfreaks.com/topic/80709-checkdnsrr-always-returns-false/ Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Try <?php $ip = $_SERVER['REMOTE_ADDR']; $dns = (checkdnsrr($ip)) ? 'True' : 'False'; echo $dns; ?> Link to comment https://forums.phpfreaks.com/topic/80709-checkdnsrr-always-returns-false/#findComment-409330 Share on other sites More sharing options...
daq Posted December 7, 2007 Author Share Posted December 7, 2007 Its actually a console app. I feed the ip manually (or it is read from a file,) but I know for sure ip is correctly formatted. Link to comment https://forums.phpfreaks.com/topic/80709-checkdnsrr-always-returns-false/#findComment-409335 Share on other sites More sharing options...
phpSensei Posted December 7, 2007 Share Posted December 7, 2007 Try echoing the IP, see if it comes out right. Link to comment https://forums.phpfreaks.com/topic/80709-checkdnsrr-always-returns-false/#findComment-409339 Share on other sites More sharing options...
daq Posted December 7, 2007 Author Share Posted December 7, 2007 <?php $ip = $argv[1]; echo $ip; echo "\n"; echo checkdnsrr($ip) ? 'True' : 'False'; #echo echo checkdnsrr($ip, 'ANY') ? 'True' : 'False'; echo "\n"; echo gethostbyaddr($ip); echo "\n" ?> "php ip.php 64.233.167.99" returns: 64.233.167.99 False py-in-f99.google.com Command that searches for ANY dns record returns false as well. Link to comment https://forums.phpfreaks.com/topic/80709-checkdnsrr-always-returns-false/#findComment-409347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.