Created
October 14, 2022 02:13
-
-
Save bmcculley/978ff1118a653cf7ada442f84b87ae5f to your computer and use it in GitHub Desktop.
An example of how to get MX records for a domain.
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 | |
$records = dns_get_record("abc.xyz", DNS_MX); | |
foreach ($records as $rec) { | |
print($rec['host']."\n"); | |
print($rec['type']."\n"); | |
print($rec['pri']."\n"); | |
print($rec['target']."\n"); | |
print($rec['class']."\n"); | |
print($rec['ttl']."\n"); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment