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. Quote Link to comment 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; ?> Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.