Important Warning:
You need to add a dot to the end of the host name to make a fully qualified domain name.
To see why, try executing the following pieces of code:
$d1="gmail.con";
$d2="gmail.con.";
$r1=checkdnsrr($d1, "MX");
$r2=checkdnsrr($d2, "MX");
var_dump($r1);
var_dump($r2);
You will see that without the dot it claims that the domain "gmail.con" is valid.
Note that if you time the "checkdnsrr()" calls you will also see it takes longer without the dot because it treats it as a relative domain and does several tries based on the host name it is running on.
NB: in case you're interested, being treated as a relative domain explains what is happening. If your host is "example.com" the relative domain will eventually resolve to "gmail.con.com." which can be looked up, hence it wrongly claims "gmail.con" exists