Example
Check DNS records:
html
<?php
$domain="example.com";
if(dns_check_record($domain,"MX")) {
echo
"Passed";
} else {
echo "Failed";
}
?>
Definition and Usage
The dns_check_record() function is an alias of the checkdnsrr() function.
Syntax
text
dns_check_record(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: | 5.0+ |