checkDNS($host); } public function getError() { return $this->error; } public function getWarnings() { return $this->warnings; } protected function checkDNS($host) { $variant = INTL_IDNA_VARIANT_2003; if ( defined('INTL_IDNA_VARIANT_UTS46') ) { $variant = INTL_IDNA_VARIANT_UTS46; } $host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.'; $Aresult = true; $MXresult = checkdnsrr($host, 'MX'); if (!$MXresult) { $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); $Aresult = checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'); if (!$Aresult) { $this->error = new NoDNSRecord(); } } return $MXresult || $Aresult; } }