Here you can find the source of getFullHostname()
public static String getFullHostname()
//package com.java2s; //License from project: Apache License import java.net.InetAddress; public class Main { /**//from w w w . ja v a 2 s .c om * @return Full hostname of this machine. */ public static String getFullHostname() { // find the hostname String hostname = "unknown"; try { final InetAddress host = InetAddress.getLocalHost(); hostname = host.getHostName(); } catch (Exception ignore) { // SWALLOWED } return hostname; } }