Returns the fully qualified Domain. A fully qualified Domain always ends with a dot (like 'www.example.com.')

@return string
345567
public function toFullyQualifiedString()
   {

      if ( empty( $this->_subdomainName ) )
      {

         if ( \is_null( $this->_sld ) )
         {
            return '';
         }

         return $this->_sld->toFullyQualifiedString();

      }

      if ( \is_null( $this->_sld ) )
      {
         return $this->_subdomainName;
      }

      return $this->_subdomainName . '.' . $this->_sld->toFullyQualifiedString();

   }
210853
public function getWebPath() : string
    {
        if ($this->fullWebPath !== null) {
            return $this->fullWebPath;
        }

        $path = rtrim($this->getSetting('webPath'), '/');

        if (filter_var($path, FILTER_VALIDATE_URL) !== false) {
            return $this->fullWebPath = $path;
        }

        if (Str::startsWith($path, '//')) {
            return $this->fullWebPath = $path;
        }

        return $this->fullWebPath = urlTo(ltrim($path, '/'));
    }
1010487
public static function domain() {
        if (is_cli()) {
            return L_URL;
        }
        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
        return defined('RUN_MODE') && RUN_MODE != 'HTTP' ? ''
        : trim($protocol . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']), '/\\');
    }
837615
public function getTld() : ?string 
    {
        if ( ! $this->hasTld()) {
            $this->setTld($this->getDefaultTld());
        }
        return $this->tld;
    }
613031
static public function getSecondDomain($domain=null)
	{
	    $domain = !empty($domain) ? $domain : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null);
	    $n = preg_match('/([^.]*\.)?([^.]*\.)?\w+\.\w+$/', $domain, $matches);
	    return $domain && isset($matches[2]) ? $matches[2] : (isset($matches[1]) ? $matches[1] : '');
	}
1373694
public function toString()
   {

      if ( empty( $this->_hostName ) )
      {
         return $this->_tld->toString();
      }

      if ( null === $this->_tld )
      {
         return $this->_hostName;
      }

      return $this->_hostName . '.' . $this->_tld->toString();

   }
1342626
public function getFullUrl() : string
    {
        $isSecure = $this->isSecure();
        $rawProtocol = strtolower($this->server->get('SERVER_PROTOCOL'));
        $parsedProtocol = substr($rawProtocol, 0, strpos($rawProtocol, '/')) . ($isSecure ? 's' : '');
        $port = $this->getPort();
        $host = $this->getHost();

        // Prepend a colon if the port is non-standard
        if ((!$isSecure && $port != '80') || ($isSecure && $port != '443')) {
            $port = ":$port";
        } else {
            $port = '';
        }

        return $parsedProtocol . '://' . $host . $port . $this->server->get('REQUEST_URI');
    }
151137
protected function defaultDomain()
    {
        if ($suffix = $this->parser->getDomainSuffix()) {
            return strtolower(camel_case(basename(getcwd()))) . '.' . $suffix;
        }
        return '';
    }
622533
protected function getRootPagesWithoutDomain()
    {
        $rootPagesWithoutDomain = [];
        $rootPages = $this->getRootPages();

        $rootPageIds = [];
        foreach ($rootPages as $rootPage) {
            $rootPageIds[] = $rootPage['uid'];
        }

        $domainRecords = $this->systemDomainRepository->findDomainRecordsByRootPagesIds($rootPageIds);
        foreach ($rootPageIds as $rootPageId) {
            $hasDomainRecord = true;
            $hasDomainInTypoScript = true;

            if (!array_key_exists($rootPageId, $domainRecords)) {
                $hasDomainRecord = false;
            }

            /** @var $siteService SiteService */
            $siteService = GeneralUtility::makeInstance(SiteService::class);
            $domain = $siteService->getFirstDomainForRootPage($rootPageId);
            if ($domain === '') {
                $hasDomainInTypoScript = false;
            }

            if (!$hasDomainRecord && !$hasDomainInTypoScript) {
                $rootPagesWithoutDomain[$rootPageId] = $rootPages[$rootPageId];
            }
        }
        return $rootPagesWithoutDomain;
    }
977637
public function getDomain() {
		$fullBaseUrl = Router::fullBaseUrl();
		if (!empty($fullBaseUrl)) {
			$domain = parse_url($fullBaseUrl, PHP_URL_HOST);
		} else {
			$domain = 'localhost';
		}

		return $domain;
	}
423250
public function getBaseURL()
    {
        $base = Director::baseURL();

        // Prepend hostname for domain mode
        $domain = $this->getDomain();
        if ($domain) {
            $base = Controller::join_links($domain->Link(), $base);
        }

        // Determine if base suffix should be appended
        $append = true;
        if ($this->getIsDefault()) {
            // Apply config
            $append = !(bool) Config::inst()->get(FluentDirectorExtension::class, 'disable_default_prefix');
        }

        if ($append) {
            // Append locale url segment
            $base = Controller::join_links($base, $this->getURLSegment(), '/');
        }

        return $base;
    }
1109971
public function getDomains() {
    $domains = array();
    $checks = $this->getChecks();
    foreach ($checks as $check) {
      $domains[$check->id] = $check->hostname;
    }
    return $domains;
  }
31840
public static function subdomains()
	{
		$domains = self::_getConfigArray();
		array_pop($domains);
		// Config contained only a single domain (".com")
		if (is_null($domains))
		{
			$domains = [];
			return $domains;
		}

		// Config contained no subdomains ("example.com")
		array_shift($domains);
		if (is_null($domains))
		{
			$domains = [];
			return $domains;
		}

		return $domains;
	}
1131096
public function getWebPath()
    {
        $webPath = $this->environment->getCurrentEnvironmentConfig()->get('Domain', false);
        if (!$webPath) {
            $webPath = Request::getInstance()->getCurrentUrl(true)->getDomain() . '/';
        }

        return $webPath;
    }
1351706
public static String domainName() {
        List<String> words = new ArrayList<String>();
        words.add(fixUmlauts(domainWord()));
        words.add(domainSuffix());
        return StringUtils.join(words, ".");

    }
1225911
public function domain($tldLength = 1)
    {
        $segments = explode('.', $this->host());
        $domain = array_slice($segments, -1 * ($tldLength + 1));

        return implode('.', $domain);
    }
1026402
public function getDomain()
    {
        $uri = $this->getServiceLocator()->get('Application')->getMvcEvent()->getRequest()->getUri();
        return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
    }