Java IP Address Get getIpHostnameLocal()

Here you can find the source of getIpHostnameLocal()

Description

get Ip Hostname Local

License

Apache License

Declaration

public static String getIpHostnameLocal() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.InetAddress;

public class Main {
    public static String getIpHostnameLocal() {
        try {/*from www  . jav  a2s .com*/
            InetAddress ip = InetAddress.getLocalHost();
            return ip.getHostName();

        } catch (Exception e) {
            return "not-found";
        }
    }
}

Related

  1. getIpByName(String name)
  2. getIpByNetworkInterfaceName(String name)
  3. getIPFromHash(final long ipHash)
  4. getIPFromInterface(String ni)
  5. getIPFromNetworkInterface()
  6. getIPList(String address)
  7. getIPList(String s, String s1)
  8. getIPs()
  9. getIPs()