Extracts host from the DNS record.
<p>
Sample record: "10 25 0 6235386366386436.my-release-hazelcast.default.svc.cluster.local".
181587
private static String extractHost(String server) {
        String host = server.split(" ")[3];
        return host.replaceAll("\\\\.$", "");
    }
766267
def get_record(self, dns_record_type, host):
        """"""
        record_list = self._entries
        for record in record_list:
            if record._record_type == dns_record_type \
                    and record.host == host:
                return record
        return False
514975
public static String extractApproximateZone(String host) {
		String[] split = StringUtils.split(host, ".");
		return split == null ? host : split[1];
	}
1128611
public static String extractPort(final String host) {
        if (containsPort(host)) {
            return host.substring(host.indexOf(":") + 1, host.length());
        } else {
            return null;
        }
    }
735776
public static HostAndPort parseString(String from){
    // NOTE: redis answers with
    // '99aa9999aa9a99aa099aaa990aa99a09aa9a9999 9a09:9a9:a090:9a::99a slave 8c88888888cc08088cc8c8c888c88c8888c88cc8 0 1468251272993 37 connected'
    // for CLUSTER NODES, ASK and MOVED scenarios. That's why there is no possibility to parse address in 'correct' way.
    // Redis should switch to 'bracketized' (RFC 3986) IPv6 address.
    try {
      String[] parts = extractParts(from);
      String host = parts[0];
      int port = Integer.parseInt(parts[1]);
      return new HostAndPort(convertHost(host), port);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException(ex);
    }
  }
1194810
public OvhGlueRecord serviceName_glueRecord_host_GET(String serviceName, String host) throws IOException {
		String qPath = "/domain/{serviceName}/glueRecord/{host}";
		StringBuilder sb = path(qPath, serviceName, host);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhGlueRecord.class);
	}
587298
private static String getHostAddress(InetSocketAddress addr) {
    String hostToAppend = "";
    if (addr.isUnresolved()) {
      hostToAppend = addr.getHostName();
    } else {
      hostToAppend = addr.getAddress().getHostAddress();
    }
    return hostToAppend;
  }
983304
def get_name(self, host_name):
        
        if wildcard_match(self._pattern, host_name):
            return host_name
        else:
            return self._fallback
68616
public String getHostName() {
        String hostName = mHostName;
        try {
            // ZAP: fixed cases, where host name is null
            hostName = ((mUri.getHost() != null) ? mUri.getHost() : mHostName);
            
        } catch (URIException e) {
            if (log.isDebugEnabled()) {
                log.warn(e);
            }
        }
        
        return hostName;
    }
661998
public static String hostNameFrom(final Connection connection) {
        if (connection instanceof IIOPConnection) {
            final IIOPConnection iiopConnection = (IIOPConnection) connection;
            return iiopConnection.getSocket().getInetAddress().getHostName();
        } else if (connection instanceof IIOPLoopbackConnection) {
            try {
                return InetAddress.getLocalHost().getCanonicalHostName();
            } catch (final UnknownHostException e) {
                return "localhost";
            }
        }
        throw new IllegalStateException("Unknown connection type: " + connection.getClass());
    }
9627
function(hostname, callback) {
  get_nodes(function(err,nodes) {
    if (err) return callback(err);

    var n = nodes.filter(function(node) {
      return node.name === hostname;
    });

    callback(null,(n.length === 1) ? n[0].ip_address : null);
  });
}
666280
def extract_domain(host):
    
    host = re.sub('https?://', '', host)
    host = re.match('([^/]+)', host).groups()[0]
    domain = '.'.join(host.split('.')[-2:])
    if domain in _domains:
        domain = '.'.join(host.split('.')[-3:])
    return domain
176872
public InetAddress getInetAddress() throws UnknownHostException{
     if(ip!=null) return ip;

     return (ip=InetAddress.getByName(host));
   }
352912
public String getServerName() {
    if (hostname != null) {
      return hostname;
    }
    boolean hasHost = urlParser != null && this.urlParser.getHostAddresses().get(0).host != null;
    return (hasHost) ? this.urlParser.getHostAddresses().get(0).host : "localhost";
  }
5495
public static String extractUserName(final String hostname) {
        if (containsUserName(hostname)) {
            return hostname.substring(0, hostname.indexOf("@"));
        } else {
            return null;
        }
    }
1164313
def hostedzone_from_element(zone):
    
    return HostedZone(
        name=maybe_bytes_to_unicode(zone.find("Name").text).encode("ascii").decode("idna"),
        identifier=maybe_bytes_to_unicode(zone.find("Id").text).replace(u"/hostedzone/", u""),
        rrset_count=int(zone.find("ResourceRecordSetCount").text),
        reference=maybe_bytes_to_unicode(zone.find("CallerReference").text),
    )
497189
def del_record(self, dns_record_type, host):
        """"""
        rec = self.get_record(dns_record_type, host)
        if rec:
            self._entries = list(set(self._entries) - set([rec]))
        return True