Why am I getting such random results when checking DNS?

Posted by animuson on Stack Overflow See other posts from Stack Overflow or by animuson
Published on 2010-04-07T04:38:07Z Indexed on 2010/04/07 4:43 UTC
Read the original article Hit count: 297

Filed under:
|
|

The code is as follows:

$domain = "fosajfjdkgdajfhsd.com";
$check1 = checkdnsrr($domain, "MX");
$check2 = checkdnsrr($domain, "A");
$check3 = (checkdnsrr($domain, "MX") || checkdnsrr($domain, "A"));
$check4 = !(checkdnsrr($domain, "MX") || checkdnsrr($domain, "A"));
die("{$check1} - {$check2} - {$check3} - {$check4}");

However when I check the output to see what it's returning, I get this:

 - 1 - 1 - 

The domain obviously wouldn't exist, so I don't understand why checking the A record is return true and checking the MX result doesn't give me anything at all. I don't understand what's going wrong here.

© Stack Overflow or respective owner

Related posts about php

Related posts about dns