Using the dns_get_record() Function : dns_get_record « DNS « PHP






Using the dns_get_record() Function

 
<?php

    $hostname = "google.com";

    $records = dns_get_record($hostname, DNS_ALL);

    echo "The domain $hostname has the following DNS records: ";

    foreach($records as $record) {

        echo "{$record['type']} ";

    }

?>
  
  








Related examples in the same category

1.Use dns_get_record() to get the DNS information associated with the hostname www.php.net.