PHP checkdnsrr() Function

PHP Network Reference : Check DNS records

Definition and Usage

The checkdnsrr() function checks DNS records for type corresponding to host.

We can use the checkdnsrr() function to check our DNS record to verify the existence of a domain name or not.

Syntax

checkdnsrr(host, type)

Parameter Values

Parameter Description
host Required. Specifies an IP address or host name to check
type Optional. Specifies the type. Can be one of the following:
  • A
  • MX (default)
  • NS
  • SOA
  • PTR
  • CNAME
  • AAAA
  • A6
  • SRV
  • NAPTR
  • TXT
  • ANY

Technical Details

Return Value: TRUE if any records are found, FALSE otherwise
PHP Version: 4.0+
PHP Changelog: PHP 5.3: Now available on Windows platforms
PHP 5.2.4: Added the TXT value of type

❮ PHP Network Reference