$domain="plus2net.com";
if(!checkdnsrr($domain,'MX')) {
echo "Not there ";
}else {
echo " It is there ";
}
getmxrr(hostname, array $result, array $weight)
If returns True of False based on the information found. Output is stored in $result as array.
$domain='example.com';
if(getmxrr($domain,$mx_details)){
foreach($mx_details as $key=>$value){
echo "$key => $value <br>";
}
}
<?php
$domain = "plus2net.com";
if (!checkdnsrr($domain, 'MX')) {
echo "Domain does not exist.";
} else {
echo "Domain exists.";
}
?>
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.