PHP dns_check_record() Function
Example
Check DNS records:
<?php
$domain="w3schools.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
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:
|
Technical Details
Return Value: | TRUE if any records are found, FALSE otherwise |
---|---|
PHP Version: | 5.0+ |
❮ PHP Network Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.