You are here

public function CheckDnsService::validateHost in Check DNS 8

Validate whether a domain name exists or not.

Parameters

string $host: A host to check.

Return value

bool TRUE if any records are found, FALSE otherwise.

1 call to CheckDnsService::validateHost()
CheckDnsService::validateEmail in src/CheckDnsService.php
Validate email id and its DNS record.

File

src/CheckDnsService.php, line 45

Class

CheckDnsService
Defines the CheckDns service.

Namespace

Drupal\check_dns

Code

public function validateHost(string $host) {

  // Check the DNS records corresponding to the hostname or IP address.
  $result = dns_check_record($host);
  return $result;
}