Do a catch-all test for the domain .
This increases checking time for a domain slightly,
but doesn't confuse users.
553701
public function catchAll() {

        $isCatchallDomain = null;
        if($this->options['catchAllEnabled']){
            try{
                $isCatchallDomain = $this->transport->getSmtp()->acceptsAnyRecipient($this->dom);

            }catch (\Exception $e) {
                $this->statusManager->setStatus($this->users, $this->dom, $this->options['catchAllIsValid'], 'error while on CatchAll test: '.$e );
            }

            // if a catchall domain is detected, and we consider
            // accounts on such domains as invalid, mark all the
            // users as invalid and move on
            if ($isCatchallDomain) {
                if (!$this->options['catchAllIsValid']) {
                    $this->statusManager->setStatus($this->users, $this->dom, $this->options['catchAllIsValid'],'catch all detected');
                    return true;
                }
            }
        }
    }
837221
protected function prepareForValidation(): void
    {
        $data = $this->all();

        $data['domain'] = $this->getHost();

        $this->replace($data);
    }
970340
def verify_challenge(uri):
    
    while True:
        try:
            resp = urlopen(uri)
            challenge_status = json.loads(resp.read().decode('utf8'))
        except IOError as e:
            raise ValueError("Error checking challenge: {0} {1}".format(
                e.code, json.loads(e.read().decode('utf8'))))
        if challenge_status['status'] == "pending":
            time.sleep(2)
        elif challenge_status['status'] == "valid":
            LOGGER.info("Domain verified!")
            break
        else:
            raise ValueError("Domain challenge did not pass: {0}".format(
                challenge_status))
1349448
def check_domain_request(self, domains):
        
        request = E.checkDomainRequest(
            E.domains(
                E.array(
                    *[E.item(
                        E.name(domain.split(".")[0]),
                        E.extension(domain.split(".")[1])
                    ) for domain in domains]
                )
            )
        )

        response = self.request(request)
        return [Model(item) for item in response.data.array.item]
1179046
def check_many(self, domains):
        
        return dict((item.domain, item.status) for item in self.check_domain_request(domains))
1013735
def check(self, regex):
        
        return self.scan_full(regex, return_string=True, advance_pointer=False)
975319
private boolean netscapeDomainMatches(final String domain, final String host) {
        if (domain == null || host == null) {
            return false;
        }

        // if there's no embedded dot in domain and domain is not .local
        boolean isLocalDomain = ".local".equalsIgnoreCase(domain);
        int embeddedDotInDomain = domain.indexOf('.');
        if (embeddedDotInDomain == 0) {
            embeddedDotInDomain = domain.indexOf('.', 1);
        }
        if (!isLocalDomain && (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1)) {
            return false;
        }

        // if the host name contains no dot and the domain name is .local
        int firstDotInHost = host.indexOf('.');
        if (firstDotInHost == -1 && isLocalDomain) {
            return true;
        }

        int domainLength = domain.length();
        int lengthDiff = host.length() - domainLength;
        if (lengthDiff == 0) {
            // if the host name and the domain name are just string-compare euqal
            return host.equalsIgnoreCase(domain);
        }
        else if (lengthDiff > 0) {
            // need to check H & D component
            String H = host.substring(0, lengthDiff);
            String D = host.substring(lengthDiff);

            return (D.equalsIgnoreCase(domain));
        }
        else if (lengthDiff == -1) {
            // if domain is actually .host
            return (domain.charAt(0) == '.' &&
                    host.equalsIgnoreCase(domain.substring(1)));
        }

        return false;
    }
196547
public static function checkDomain()
	{
		$domain = Config::get('@.DOMAIN');
		return empty($domain) || !Config::get('@.FILTER_DOMAIN') || $domain === Request::server('HTTP_HOST');
	}
578150
protected void validate(final boolean isDomain) throws MojoDeploymentException {
        final boolean hasServerGroups = hasServerGroups();
        if (isDomain) {
            if (!hasServerGroups) {
                throw new MojoDeploymentException(
                        "Server is running in domain mode, but no server groups have been defined.");
            }
        } else if (hasServerGroups) {
            throw new MojoDeploymentException("Server is running in standalone mode, but server groups have been defined.");
        }
    }
312304
public void ensureDomainsFileInstalled() throws IOException{
		// Quick check for availability
		domainsFileLock.readLock().lock();
		logger.trace("LOCK readlock");
		try {
			if( allDomains != null ) {
				return;
			}
		} finally {
			logger.trace("UNLOCK readlock");
			domainsFileLock.readLock().unlock();
		}

		// Download domains
		domainsFileLock.writeLock().lock();
		logger.trace("LOCK writelock");
		try {
			if( !domainsAvailable() ) {
				downloadDomains();
			}
			parseDomains();
		} finally {
			logger.trace("UNLOCK writelock");
			domainsFileLock.writeLock().unlock();
		}
	}
309002
def check_dns_txt(domain, prefix, code):
    
    token = '{}={}'.format(prefix, code)
    try:
        for rr in dns.resolver.query(domain, 'TXT'):
            if token in rr.to_text():
                return True
    except:
        logger.debug('', exc_info=True)
    return False
145532
private static boolean matchesWildcardPublicSuffix(String domain) {
    final String[] pieces = domain.split(DOT_REGEX, 2);
    return pieces.length == 2 && PublicSuffixPatterns.UNDER.containsKey(pieces[1]);
  }
586180
function isDomainValid (domain) {
  if (!domain) {
    return false
  }

  const [min, max] = domain
  const isValid = isPresent(min) && !isNaN(min) && isPresent(max) && !isNaN(max)
  if (!isValid) {
    Logger.debug(`Invalid domain: [${min}, ${max}]`)
  }

  return isValid
}
105914
def validate(self):
        '''
        '''

        self._populate_domain()
        missing = []
        for domain_device in self.domain:
            for truster, trustees in iteritems(self.domain):
                if domain_device not in trustees:
                    missing.append((domain_device, truster, trustees))

        if missing:
            msg = ''
            for item in missing:
                msg += '\n%r is not trusted by %r, which trusts: %r' % \
                    (item[0], item[1], item[2])
            raise DeviceNotTrusted(msg)
        self.device_group = DeviceGroup(
            devices=self.devices,
            device_group_name=self.device_group_name,
            device_group_type=self.device_group_type,
            device_group_partition=self.partition
        )
410151
private function checkFailure() : void
    {
        $failure = (int) $this->session->get('failure', 0);
        $time    = (int) $this->session->get('failure_time', time());
        if ($failure >= static::FAILURE) {
            if ($time >= time()) {
                throw new \DomainException($this->i18n->t(
                    'setrun/user',
                    'Form is blocked for {min} minutes',
                    ['min' => static::FAILURE_TIME / 60])
                );
            }
            $this->removeFailure();
        }
    }
1279555
def detect!(time = 2, warmup = 1)
      ::Benchmark.ips do |x|
        x.config(time: time, warmup: warmup)
        TEST_STRINGS_FLAT.each do |scheme, string|
          x.report("Detect #{scheme}") do
            Sanscript::Detect.detect_scheme(string)
          end
        end
        x.compare!
      end
      true
    end
602933
def filter_by_domain(self, domain):
        
        query = self._copy()
        query.domain = domain
        return query