Check DNS records corresponding to a given Internet host name or IP address
Syntax
checkdnsrr ( string $host [, string $type = "MX" ] ) : bool
Parameters
host
host may either be the IP address in dotted-quad notation or the host name.
type
type may be any one of: A, MX, NS, SOA, PTR, CNAME, AAAA, A6, SRV, NAPTR, TXT or ANY.
Return
Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred.
Examples
1 · host
<? $host = "osbo.com"; $return = checkdnsrr($host); var_export($return); ?>
true
2 · type
<? $host = "osbo.com"; $type = "A"; $return = checkdnsrr($host, $type); var_export($return); ?>
true