dns_get_record
laravel/framework
Supported Versions: PHP 5, PHP 7, PHP 8
Fetch DNS Resource Records associated with a hostname
dns_get_record
(
string $hostname
,
int $type
=
DNS_ANY
,
array
&
$authoritative_name_servers
=
null
,
array
&
$additional_records
=
null
,
bool $raw
=
false
): array|
false
if (
$url
=
parse_url
(
$value
,
PHP_URL_HOST
)) {
try {
return
count
(
dns_get_record
(
$url
.
'.'
,
DNS_A
|
DNS_AAAA
)) >
0
;
} catch (
Exception $e
) {
return
false
;
}
src/Illuminate/Validation/Concerns/ValidatesAttributes.php