Here you can find the source of getFullyQualifiedHostName()
public static String getFullyQualifiedHostName()
//package com.java2s; //License from project: Open Source License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static String getFullyQualifiedHostName() { String localhost = null;//from w w w.j a v a 2 s . c o m try { localhost = InetAddress.getLocalHost().getCanonicalHostName().toLowerCase(); } catch (UnknownHostException e) { e.printStackTrace(); localhost = "Unknown Host"; } return localhost; } }