PHP/Network/DNS Validation
DNS Validation Demo
<html>
<head>
<title> hostname validator </title>
</head>
<body>
<?php
$hostname = "www.wbex.ru";
if (!isset($hostname)) {
die("Hostname value wasn"t properly submitted. Retry.");
}
if(empty($hostname)){
die("Hostname field was left blank ! Retry.");
}
echo "<b>". $hostname ."</b> ";
if(checkdnsrr($hostname)) {
echo "has a valid MX record !<br>";
}else{
die("does not exist");
}
?>
</body>
</html>