Edit report at http://bugs.php.net/bug.php?id=53025&edit=1
ID: 53025 User updated by: uni at daniel-marschall dot de Reported by: uni at daniel-marschall dot de Summary: checkdnsrr() result vary for specific server Status: Bogus Type: Bug Package: *Network Functions Operating System: Various PHP Version: Irrelevant Block user comment: N New Comment: It sounds logical that PHP calls the OS's DNS resolution and it is likely that it is not a PHP bug. But I am just very confused about this. I checked following script <?php $result = dns_get_record("us.ibm.com"); print_r($result); ?> at the systems which output "A-records available". At these two systems, Windows and Debian Linux, I get the same list as you get: TXT entries and many MX entries. So, my big question is: Why is checkdnsrr('us.ibm.com', 'A')=true at some systems when dns_get_record() is without any [type]='A' entry? Previous Comments: ------------------------------------------------------------------------ [2010-10-10 18:42:11] paj...@php.net I don't think it is a bug in PHP. Both on windows and linux PHP uses the system functions. They return the requested records and PHP only transforms them to be usable by a PHP script. I checked the us.ibm.com domains, the issue I can see is some recursive resolution, which creates confusions with some dns clients or relays (DNS intermediate server). But that's not something PHP can solve. Below is the answer for mines, as you can see, no A entry, checkdnsrr returns false as well, obviously. Closing this bug as not a php bug > bogus. Array ( [0] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e39.co.us.ibm.com [class] => IN [ttl] => 3583 ) [1] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e9.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [2] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e5.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [3] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e3.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [4] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e4.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [5] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e37.co.us.ibm.com [class] => IN [ttl] => 3583 ) [6] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e6.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [7] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e2.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [8] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e31.co.us.ibm.com [class] => IN [ttl] => 3583 ) [9] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e35.co.us.ibm.com [class] => IN [ttl] => 3583 ) [10] => Array ( [host] => us.ibm.com [type] => TXT [txt] => v=spf1 ip4:32.97.182.0/24 ip4:32.97.110.0/24 a:d25xlcore010.ca.ibm.com a:isource.boulder.ibm.com ~all [entries] => Array ( [0] => v=spf1 ip4:32.97.182.0/24 ip4:32.97.110.0/24 a:d25xlcore010.ca.ibm.com a:isource.boulder.ibm.com ~all ) [class] => IN [ttl] => 583 ) [11] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e38.co.us.ibm.com [class] => IN [ttl] => 3583 ) [12] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e8.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [13] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e32.co.us.ibm.com [class] => IN [ttl] => 3583 ) [14] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e33.co.us.ibm.com [class] => IN [ttl] => 3583 ) [15] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e1.ny.us.ibm.com [class] => IN [ttl] => 3583 ) [16] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e34.co.us.ibm.com [class] => IN [ttl] => 3583 ) [17] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e36.co.us.ibm.com [class] => IN [ttl] => 3583 ) [18] => Array ( [host] => us.ibm.com [type] => MX [pri] => 10 [target] => e7.ny.us.ibm.com [class] => IN [ttl] => 3583 ) ) ------------------------------------------------------------------------ [2010-10-10 16:10:24] uni at daniel-marschall dot de WRONG results at: - Windows XP Home 5.1.2600 SP 3, PHP 5.3.1 and PHP 5.3.3 (both PHP versions tested) - Linux version 2.6.24-etchnhalf.1-686 (Debian 2.6.24-6~etchnhalf.9etch3) (da...@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Thu Feb 25 05:42:02 UTC 2010 . ------------------------------------------------------------------------ [2010-10-10 14:45:49] paj...@php.net I asked which OS and which versions of these OSes do you use. Please answer. ------------------------------------------------------------------------ [2010-10-10 06:50:44] uni at daniel-marschall dot de Hello. I DO think that it is a bug in PHP. To your question, which OS I am using, please look in my initial comment again. I ran this testscript with wrong results on Windows AND Linux. It is not possible that my DNS/ISP is fault since I got also a Java application which checks A-records and there "us.ibm.com" has no A-records. But the PHP script says, A-records are available. ------------------------------------------------------------------------ [2010-10-09 01:50:43] paj...@php.net Which operating system are you using exactly? Windows (which version?) Or linux? Windows has a different DNS implementation than unix. Also different results may be due to the use of different DNS servers. Be sure to check that every client uses the same. On windows you don't have to install PHP to test a new version but simply uncompress the zip somewhere and run: php -n dns.php from the php directory. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=53025 -- Edit this bug report at http://bugs.php.net/bug.php?id=53025&edit=1