Skip to content

Instantly share code, notes, and snippets.

@agarzon
Last active May 8, 2017 10:04
Show Gist options
  • Save agarzon/2855097 to your computer and use it in GitHub Desktop.
Save agarzon/2855097 to your computer and use it in GitHub Desktop.
Get DNS information from domain name with PHP
<?php
// Get nameserver from a domain name.
function getNameservers($hostname) {
$result = dns_get_record($hostname, DNS_NS);
foreach($result as $record) {
$return[] = $record['target'];
}
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment