Check DNS error : DNS « Network « PHP






Check DNS error


<?php
   $email = "j@java2s.com";
   $domain = explode("@",$email);
   $valid = checkdnsrr($domain[1], "ANY");
   if($valid) 
      echo "The domain has an MX record!";
   else 
      echo "Cannot locate MX record for $domain[1]!";
?>

           
       








Related examples in the same category

1.getservbyname: get server by name
2.getservbyport: get server by port
3.Get MX records corresponding to a given Internet host name