PHP/DNS/dns get record

Материал из Web эксперт
Перейти к: навигация, поиск

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

 
<?php 
$record = dns_get_record("www.php.net"); 
print_r($record); 
?>



Using the dns_get_record() Function

 
<?php
    $hostname = "google.ru";
    $records = dns_get_record($hostname, DNS_ALL);
    echo "The domain $hostname has the following DNS records: ";
    foreach($records as $record) {
        echo "{$record["type"]} ";
    }
?>