protected function dnsResolutionIsOk($domain = null, $ip = null)
    {
        if ($this->dnsAlreadyResolved) {
            return true;
        }

        $domain = $domain ? $domain: $this->obtainDomain();
        $ip = $ip ? $ip: $this->obtainIp();

        if ($domain != null && $ip != null) {
            $resolved_ip = gethostbyname($domain);
            if ($resolved_ip != $domain && $resolved_ip == $ip) {
                $this->dnsAlreadyResolved = true;
                return true;
            }
        }
        return false;
    }