dns_get_record($hostname, DNS_ALL) - This PHP function fetches the DNS resource records associated with the given hostname. By default, this tool will search for all record types with the DNS_ALL parameter.
PHP Cookbook: Solutions & Examples