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']} "; } ?>