Last active
May 8, 2017 10:04
-
-
Save agarzon/2855097 to your computer and use it in GitHub Desktop.
Get DNS information from domain name with PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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