Java Host Check isLocal(final String hostname)

Here you can find the source of isLocal(final String hostname)

Description

is Local

License

Apache License

Declaration

static boolean isLocal(final String hostname) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.net.InetAddress;

import java.net.UnknownHostException;

public class Main {
    static boolean isLocal(final String hostname) {
        try {/*from   w w  w  .j a v a  2 s. co  m*/
            return InetAddress.getByName(hostname).isLoopbackAddress();
        } catch (UnknownHostException e) {
            return false;
        }
    }
}

Related

  1. checkHostIsAvailable(String hostName)
  2. checkHostName(String hostName)
  3. isHostReachable(String host, int timeout)
  4. isInternalHostname(String host)
  5. isLocal(final String hostName)
  6. isThisMe(String hostname)
  7. normalizeHost(String host)
  8. normalizeHostName(String name)
  9. normalizeHostNames(Collection names)