returns String with all the private dns of the Front End servers
 used for setting the LB_HOSTNAME input.
763938
def get_lb_hostname_input
      lb_hostname_input = "text:"
      fe_servers.each do |fe|
        timeout = 30
        loopcounter = 0
        begin
          if fe.settings['private-dns-name'] == nil
            raise "FATAL: private DNS name is empty" if loopcounter > 10
            sleep(timeout)
            loopcounter += 1
            next
          end
          lb_hostname_input << fe.settings['private-dns-name'] + " "
          done = true
        end while !done
      end
      lb_hostname_input
    end
913715
def my_address_string(self):
        
        addr = getattr(self, 'client_address', ('', None))[0]

        # If listed in proxy_ips, use the X-Forwarded-For header, if present.
        if addr in self.proxy_ips:
            return self.headers.getheader('x-forwarded-for', addr)
        return addr
1190533
public java.util.Map<String, String> getDomainNames() {
        if (domainNames == null) {
            domainNames = new com.amazonaws.internal.SdkInternalMap<String, String>();
        }
        return domainNames;
    }
336952
public static function hostname()
    {
        $hostName = null;
        $forwardedHostsString = self::serverVariable( 'HTTP_X_FORWARDED_HOST', true );
        if ( $forwardedHostsString )
        {
            $forwardedHosts = explode( ',', $forwardedHostsString );
            $hostName = trim( $forwardedHosts[0] );
        }

        if ( !$hostName && self::serverVariable( 'HTTP_HOST', true ) )
        {
            $hostName = self::serverVariable( 'HTTP_HOST' );
        }

        if ( !$hostName )
        {
            $siteUrl = eZINI::instance()->variable( 'SiteSettings', 'SiteURL' );
            $hostName = parse_url( "http://{$siteUrl}", PHP_URL_HOST );
        }

        return $hostName;
    }
832229
def server_hostname(self):
        
        result = c_char_p(
            self.lib.iperf_get_test_server_hostname(self._test)
        ).value
        if result:
            self._server_hostname = result.decode('utf-8')
        else:
            self._server_hostname = None
        return self._server_hostname
789367
public static function getWebServerSoftWare() : string
    {
        static $type;

        if (isset($type)) {
            return $type;
        }

        $software = isset($_SERVER['SERVER_SOFTWARE'])
            ? $_SERVER['SERVER_SOFTWARE']
            : null;

        $type = self::SERVER_TYPE_UNKNOWN;

        if (stripos($software, 'lighttpd') !== false) {
            $type = self::SERVER_TYPE_LIGHTTPD;
        }

        if (strpos($software, 'Hiawatha') !== false) {
            $type = self::SERVER_TYPE_HIAWATHA;
        }

        if (strpos($software, 'Apache') !== false) {
            $type = self::SERVER_TYPE_APACHE;
        } elseif (strpos($software, 'Litespeed') !== false) {
            $type = self::SERVER_TYPE_LITESPEED;
        }

        if (strpos($software, 'nginx') !== false) {
            $type = self::SERVER_TYPE_NGINX;
        }

        if ($type !== self::SERVER_TYPE_APACHE && $type !== self::SERVER_TYPE_LITESPEED
            && strpos($software, 'Microsoft-IIS') !== false
            && strpos($software, 'ExpressionDevServer') !== false
        ) {
            $type = self::SERVER_TYPE_IIS;
            if (intval(substr($software, strpos($software, 'Microsoft-IIS/')+14)) >= 7) {
                $type = self::SERVER_TYPE_IIS7;
            }
        }
        if (function_exists('apache_get_modules')) {
            if (in_array('mod_security', apache_get_modules())) {
                $type = self::SERVER_TYPE_APACHE;
            }

            if ($type == self::SERVER_TYPE_UNKNOWN && function_exists('apache_get_version')) {
                $type = self::SERVER_TYPE_APACHE;
            }
        }

        return $type;
    }
1356033
private DnsServerAddressStream getNameServersFromCache(String hostname) {
        int len = hostname.length();

        if (len == 0) {
            // We never cache for root servers.
            return null;
        }

        // We always store in the cache with a trailing '.'.
        if (hostname.charAt(len - 1) != '.') {
            hostname += ".";
        }

        int idx = hostname.indexOf('.');
        if (idx == hostname.length() - 1) {
            // We are not interested in handling '.' as we should never serve the root servers from cache.
            return null;
        }

        // We start from the closed match and then move down.
        for (;;) {
            // Skip '.' as well.
            hostname = hostname.substring(idx + 1);

            int idx2 = hostname.indexOf('.');
            if (idx2 <= 0 || idx2 == hostname.length() - 1) {
                // We are not interested in handling '.TLD.' as we should never serve the root servers from cache.
                return null;
            }
            idx = idx2;

            DnsServerAddressStream entries = authoritativeDnsServerCache().get(hostname);
            if (entries != null) {
                // The returned List may contain unresolved InetSocketAddress instances that will be
                // resolved on the fly in query(....).
                return entries;
            }
        }
    }
4971
public function getDnsName(): string
    {
        $host = $this->environment["HTTP_HOST"] ?? "";
        $port = strpos($host, ":");
        if ($port !== false) {
            return substr($host, 0, $port);
        }
        return $host;
    }
1196230
def get_forwarders(resolv="resolv.conf"):
    
    ns = []
    if os.path.exists(resolv):
        for l in open(resolv):
            if l.startswith("nameserver"):
                address = l.strip().split(" ", 2)[1]
                # forwarding to ourselves would be bad
                if not address.startswith("127"):
                    ns.append(address)
    if not ns:
        ns = ['8.8.8.8', '8.8.4.4']
    return ns
77057
def get_instance_route53_names(self, instance):
        '''  '''

        instance_attributes = [ 'public_dns_name', 'private_dns_name',
                                'ip_address', 'private_ip_address' ]

        name_list = set()

        for attrib in instance_attributes:
            try:
                value = getattr(instance, attrib)
            except AttributeError:
                continue

            if value in self.route53_records:
                name_list.update(self.route53_records[value])

        return list(name_list)
229834
def GetValidHostsForCert(cert):
  
  if 'subjectAltName' in cert:
    return [x[1] for x in cert['subjectAltName'] if x[0].lower() == 'dns']
  else:
    return [x[0][1] for x in cert['subject']
            if x[0][0].lower() == 'commonname']
626568
private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
            $buffer = $this->_get_Win32_ComputerSystem();
            if (!$buffer && CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName /v ComputerName', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^\s*ComputerName\s+REG_SZ\s+(\S+)\s*$/mi", $strBuf, $buffer2)) {
                    $buffer[0]['Name'] = $buffer2[1];
            }
            if ($buffer) {
                $result = $buffer[0]['Name'];
                $ip = gethostbyname($result);
                if ($ip != $result) {
                    if ((version_compare("10.0.0.0", $ip, "<=") && version_compare($ip, "10.255.255.255", "<=")) ||
                        (version_compare("172.16.0.0", $ip, "<=") && version_compare($ip, "172.31.255.255", "<=")) ||
                        (version_compare("192.168.0.0", $ip, "<=") && version_compare($ip, "192.168.255.255", "<=")) ||
                        (version_compare("127.0.0.0", $ip, "<=") && version_compare($ip, "127.255.255.255", "<=")) ||
                        (version_compare("169.254.1.0", $ip, "<=") && version_compare($ip, "169.254.254.255", "<=")) ||
                        (version_compare("255.255.255.255", $ip, "=="))) {
                        $this->sys->setHostname($result); // internal ip
                    } else {
                        $this->sys->setHostname(gethostbyaddr($ip));
                    }
                }
            } else {
                if (CommonFunctions::readenv('COMPUTERNAME', $hnm)) $this->sys->setHostname($hnm);
            }
        }
    }
351618
public String getDomains() {
		StringWriter sw = new StringWriter();
		JsonGenerator generator;
		if (this.prettyFormat != Format.NONE) {
			JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
			generator = gf.createGenerator(sw);
		} else
			generator = Json.createGenerator(sw);
		
		generator.writeStartArray();
		List<String> doms = DomainInformation.availableDomains(dbAccess);
		for (String dom : doms) {
			generator.write(dom);
		}
		generator.writeEnd();

		generator.flush();
		return sw.toString();
	}
76684
private List<ServerAddress> getServerAddressList(List<String> addressStringList) throws UnknownHostException {

        List<ServerAddress> addressList = new ArrayList<>();

        for (String addressString : addressStringList) {
            addressList.add(new ServerAddress(addressString));
        }
        return addressList;
    }
688676
public List<InetAddress> getSystemDNSServers() {

        List<InetAddress> dnsServers = new ArrayList<InetAddress>();
        ResolverConfig resolverConfig = new ResolverConfig();

        try {
            for(String dnsHostIp : resolverConfig.servers()) {
                if(dnsHostIp.equals("")) continue;
                dnsServers.add(InetAddress.getByName(dnsHostIp));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dnsServers;
    }
906495
def get_asns(self, privaddr=0):
        """"""
        ips = {}
        if privaddr:
            for k, v in self._ips.items():
                if not is_private_addr(k):
                    ips[k] = v
        else:
            ips = self._ips
        #
        # Special case for the loopback IP Address: 127.0.0.1 - Do not ASN resolve...
        if '127.0.0.1' in ips:
            del ips['127.0.0.1']
        #
        # ASN Lookup...
        asnquerylist = dict.fromkeys(map(lambda x: x.rsplit(" ", 1)[0], ips)).keys()
        if self._asres is None:
            asnlist = []
        else:
            try:
                asnlist = self._asres.resolve(*asnquerylist)
            except:
                pass
        for ip, asn, desc, in asnlist:
            if asn is None:
                continue
            iplist = self._asns.get(asn, [])  # Get previous ASN value
            iplist.append(ip)			# Append IP Address to previous ASN

            #
            # If ASN is a string Convert to a number: (i.e., 'AS3257' => 3257)
            if type(asn) == str:
                asn = asn.upper()
                asn = asn.replace('AS', '')
                try:
                    asn = int(asn)
                    self._asns[asn] = iplist
                    self._asds[asn] = desc
                except:
                    continue
            else:
                self._asns[asn] = iplist
                self._asds[asn] = desc
386425
def lookup!(nameserver=nil)
      resolver = Resolv.resolver(nameserver)
      hosts = begin
                resolver.getnames(self.address.to_s)
              rescue
                []
              end

      hosts.map! do |name|
        HostName.first_or_create(
          :address => name,
          :ip_addresses => [self]
        )
      end

      return hosts
    end