Check DNS records corresponding to a given Internet host name or IP address in PHP

Description

The following code shows how to check DNS records corresponding to a given Internet host name or IP address.

Example


<?php//from  w  w  w . ja  v  a  2  s . c o  m
    $recordexists = checkdnsrr("example.com", "ANY");
    if ($recordexists) 
      echo "The domain name exists!";
    else 
      echo "The domain name does not appear to exist!";
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions