dns_check_record()

dns_check_record() — Alias of checkdnsrr().

Built-in function of PHP 8.5. The manual lists it as available in PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

dns_check_record() is an alias of checkdnsrr(): same parameters, same return value.

Signature

dns_check_record(string $hostname, string $type = "MX"): bool

Parameters

ParameterTypeWhat it takes
$hostnamestringhostname may either be the IP address in dotted-quad notation or the host name.
$typestringtype may be any one of: A, MX, NS, SOA, PTR, CNAME, AAAA, A6, SRV, NAPTR, TXT or ANY.

Return value

Returns true if any records are found; returns false if no records were found or if an error occurred.

Example

The PHP manual ships no example for dns_check_record(); the signature and the parameter table above are the contract.

All PHP 8.5 built-in functions

Reference card built from the PHP manual page dns_check_record() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.