Tells whether or not the given domain is one of the domains in scope.

@param domain the domain to check
@return {@code true} if it's a domain in scope, {@code false} otherwise.
@see #scopes
@see #isDomainAlwaysInScope(String)
511674
private boolean isDomainInScope(String domain) {
		for (String scope : scopes) {
			if (domain.matches(scope)) {
				return true;
			}
		}
		return false;
	}
1338989
public function isIgnoredDomain($domain)
    {
        if ($ignoreRegexes = $this->config()->get('ignore_domain_regexes')) {
            foreach ($ignoreRegexes as $ignore) {
                if (preg_match($ignore, $domain) > 0) {
                    return true;
                }
            }
        }

        return false;
    }
916652
function setDomain(domain) {
    checkIsObject('domain', domain);
    checkIsString('doamin.name', domain.name);
    //test domain, domain.name
    domainsMap = domainsMap.set(domain.name, domain);
}
78977
public boolean isMBeanRequired(final String domainName, final String className) {

        if(domains == null || domains.length == 0)
            return true; // No domain configuration set. All domains should pass

        for(MBeanProducerDomainConfig domainConfig : domains)
            if(domainConfig.getName().equalsIgnoreCase(domainName)) {
                // Domain was found in configuration. Now checking mbean class.
                return ArrayUtils.contains(domainConfig.getClasses(), className);

        }

        // mbean with given domain and class is not required by configuration
        return false;

    }
105664
public void setDomains(java.util.Collection<Domain> domains) {
        if (domains == null) {
            this.domains = null;
            return;
        }

        this.domains = new java.util.ArrayList<Domain>(domains);
    }
1223889
function isSubdomainOf(subdomain, host) {

        // Comparisons must be case-insensitive
        subdomain   = subdomain.toLowerCase();
        host        = host.toLowerCase();

        // If we're ignoring www, remove it from both
        // (if www is the first domain component...)
        if (crawler.ignoreWWWDomain) {
            subdomain = subdomain.replace(/^www./ig, "");
            host = host.replace(/^www./ig, "");
        }

        // They should be the same flipped around!
        return subdomain.split("").reverse().join("").substr(0, host.length) ===
                host.split("").reverse().join("");
    }
283711
public static function currentOrFailByDomain($domain)
	{
		$factor = static::all()->whereEquals('user_id', User::get('id'))
		                       ->whereEquals('domain', $domain)
		                       ->row();

		return ($factor->isNew()) ? false : $factor;
	}
145532
private static boolean matchesWildcardPublicSuffix(String domain) {
    final String[] pieces = domain.split(DOT_REGEX, 2);
    return pieces.length == 2 && PublicSuffixPatterns.UNDER.containsKey(pieces[1]);
  }
1004499
public function matchDomain($domain)
    {
        $host = $this->host;
        if (is_null($host)) {
            return false;
        }

        $match_domain = explode('.', $domain);
        $match_host = array_slice(explode('.', $host), count($match_domain) * -1);

        return (strcasecmp($domain, implode('.', $match_host)) === 0);
    }
691436
public static boolean isDomainEqualsLocal(String domainName) {
		if (StringUtils.isBlank(domainName)) {
			return false;
		}
		try {
			InetAddress host = InetAddress.getByName(domainName);
			String domainAddress = host.getHostAddress();
			if (domainAddress.equals(getLocalHostAddress())) {
				return true;
			} else {
				return false;
			}

		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		return false;
	}
313412
public void setDomainCacheFullUrl(String domain, boolean setting) {
        SetDomainCacheFullUrlRequest request = new SetDomainCacheFullUrlRequest()
                .withDomain(domain);
        request.setCacheFullUrl(setting);
        setDomainCacheFullUrl(request);
    }
776848
public void setDomainInfos(java.util.Collection<DomainInfo> domainInfos) {
        if (domainInfos == null) {
            this.domainInfos = null;
            return;
        }

        this.domainInfos = new java.util.ArrayList<DomainInfo>(domainInfos);
    }
73174
public static function domainToUnicode($domain)
    {
        return mb_strlen($domain, 'UTF-8') <= self::PHP_IDN_HANDLEABLE_LENGTH
            ? idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46)
            : false;
    }
698921
public static function isDnsError(string $domain): bool
    {
        if (\function_exists('checkdnsrr')) {
            /** @noinspection IfReturnReturnSimplificationInspection */
            $mxFound = \checkdnsrr($domain . '.', 'MX');
            if ($mxFound === true) {
                return false;
            }

            $aFound = \checkdnsrr($domain . '.', 'A');
            /** @noinspection IfReturnReturnSimplificationInspection */
            if ($aFound === true) {
                return false;
            }

            return true;
        }

        throw new \Exception(' Can\'t call checkdnsrr');
    }
502547
public static boolean isDomainSuffix(String domain, String domainSuffix) {
        if (domain.length() < domainSuffix.length()) {
            return false;
        }
        if (domain.length() == domainSuffix.length()) {
            return domain.equals(domainSuffix);
        }

        return domain.endsWith(domainSuffix) && domain.charAt(domain.length() - domainSuffix.length() - 1) == '.';
    }
1182202
def _is_domain_match(domain: str, hostname: str) -> bool:
        """"""
        if hostname == domain:
            return True

        if not hostname.endswith(domain):
            return False

        non_matching = hostname[:-len(domain)]

        if not non_matching.endswith("."):
            return False

        return not is_ip_address(hostname)
146356
private boolean checkDomainRanges(SortedSet<String> domainRanges) {

		if ( (domainRanges == null) || (domainRanges.size() == 0)){
			return true;
		}

		for ( String d : domainRanges){
			//System.out.println("domainRange: >" + d +"< " + d.length());
			if ( (d != null) && (d.length() >0)){
				return false;
			}
		}

		return true;
	}