HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

checkdnsrr

Description

The checkdnsrr of Network for PHP checks DNS records corresponding to a given Internet host name or IP address.

Syntax

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

Parameters

hostname

hostname 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 · hostname

<?

$hostname = "osbo.com";

$return = checkdnsrr($hostname);

var_export($return);
true

2 · type

<?

$hostname = "osbo.com";
$type = "A";

$return = checkdnsrr($hostname, $type);

var_export($return);
true