Retrieve the name of the request host

@return string
4971
public function getDnsName(): string
    {
        $host = $this->environment["HTTP_HOST"] ?? "";
        $port = strpos($host, ":");
        if ($port !== false) {
            return substr($host, 0, $port);
        }
        return $host;
    }
711327
public static function fullServerName()
    {
        //$protocol = ($_SERVER['SERVER_PORT'] == '443') ? 'https://' : 'http://';
        $protocol = $_SERVER['REQUEST_SCHEME'] . '://';

        if ( isset($_SERVER['HTTP_X_FORWARDED_SERVER']) ) {
            $host = $_SERVER['HTTP_X_FORWARDED_SERVER'];
        } else {
            $host = $_SERVER['SERVER_NAME'] ?? '';
        }

        $port = ($_SERVER['SERVER_PORT'] == 80) ? '' : ":{$_SERVER['SERVER_PORT']}";

        return $protocol . $host . $port;
    }
406925
function getHost()
    {
        if ($this->host)
            return $this->host;
        
        // attempt to get host from target uri
        $host  = $this->getTarget();
        $host  = parse_url($host, PHP_URL_HOST);
        if (!$host && $this->headers()->has('Host')) {
            /** @var iHeader $host */
            $host = $this->headers()->get('Host');
            $host = $host->renderValueLine();
        }

        return $host;
    }
345703
public function getRemoteHostname() {
        static $hostname = null;
        if (!$hostname) {
            /** @var string $hostname */
            $hostname = NetTools::getHostByAddress($this->getRemoteAddress());
        }
        return $hostname;
    }
915711
public static function getHostname($url)
    {
        if (!isset(self::$cache[$url]['hostname'])) {
            self::$cache[$url]['hostname'] = self::parseUrl($url, PHP_URL_HOST);
        }

        return self::$cache[$url]['hostname'];
    }
218854
public function HostAndPort() {
      $Host = $this->Host();
      $Port = $this->Port();
      if (!in_array($Port, array(80, 443)))
         return $Host.':'.$Port;
      else
         return $Host;
   }
24540
def get_name(self):
        
        dependent_host_name = 'unknown'
        if getattr(self, 'dependent_host_name', None):
            dependent_host_name = getattr(
                getattr(self, 'dependent_host_name'), 'host_name', 'unknown'
            )
        host_name = 'unknown'
        if getattr(self, 'host_name', None):
            host_name = getattr(getattr(self, 'host_name'), 'host_name', 'unknown')
        return dependent_host_name + '/' + host_name
254446
def get_name(self):
        
        if not self.is_tpl():
            try:
                return self.host_name
            except AttributeError:  # outch, no hostname
                return 'UNNAMEDHOST'
        else:
            try:
                return self.name
            except AttributeError:  # outch, no name for this template
                return 'UNNAMEDHOSTTEMPLATE'
226310
public static function getHttpHost():string
    {
        static $hostname = null;
        
        if (!$hostname) {
            $http = filter_input(INPUT_SERVER, 'HTTPS') ? 'https://' : 'http://';
            $hostname = $http . filter_input(INPUT_SERVER, 'HTTP_HOST');
        }
        return $hostname;
    }
97902
public function get_hostlist()
    {
        $default_hosts = (array) $this->getprop('default_host');
        $out           = array();

        foreach ($default_hosts as $key => $name) {
            if (!empty($name)) {
                $out[] = rcube_utils::parse_host(is_numeric($key) ? $name : $key);
            }
        }

        return $out;
    }
1095088
public function getHostname()
    {
        $stringIp = $this->toString();

        $host = strtolower(@gethostbyaddr($stringIp));

        if ($host === '' || $host === $stringIp) {
            return null;
        }

        return $host;
    }
923682
protected function getHostList()
    {
        $hosts = array_values($this->hosts);
        if ($this->params['randomize']) {
            shuffle($hosts);
        }
        return $hosts;
    }
216221
public function getName()
    {
        $name = '';

        switch ($this->_clientId)
        {
            case Bootstrapper::SITE:
                $name = 'site';
                break;
            case Bootstrapper::ADMIN:
                $name = 'administrator';
                break;
            default:
                $name = 'cli';
                break;
        }

        return $name;
    }
423749
protected function getRequestIp()
    {
        if (isset($this->server['HTTP_X_FORWARDED_FOR'])) {
            return $this->server['HTTP_X_FORWARDED_FOR'];
        }

        if (isset($this->server['REMOTE_ADDR'])) {
            return $this->server['REMOTE_ADDR'];
        }
    }
735621
public static function getRequestName(): string
    {
        if (substr(static::class, -strlen(static::REQUEST_SUFFIX)) !== static::REQUEST_SUFFIX) {
            throw new \Exception("Request class name must end with '".static::REQUEST_SUFFIX."'");
        }

        return substr(static::getMainNamespaceAndRequestParts()[3], 0, -strlen(static::REQUEST_SUFFIX));
    }
1084689
public function getName()
    {
        $mainContact = $this->Reservation()->MainContact();
        if ($this->getSurname()) {
            return trim("{$this->getFirstName()} {$this->getSurname()}");
        } elseif ($mainContact->exists() && $mainContact->getSurname()) {
            return _t('Attendee.GUEST_OF', 'Guest of {name}', null, array('name' => $mainContact->getName()));
        } else {
            return null;
        }
    }
1296055
public static function host(): ?string
    {
        $ip = self::ip();

        if (isset(static::$hosts[$ip])) {
            return static::$hosts[$ip];
        }

        $host = gethostbyaddr($ip);
        static::$hosts[$ip] = ($host === '') ? null : $host;
        return static::$hosts[$ip];
    }