Here you can find the source of getDNSName(String s)
public static String getDNSName(String s)
//package com.java2s; import java.net.InetAddress; import java.net.UnknownHostException; public class Main { private static boolean enableDNS = true; public static String getDNSName(String s) { if (!enableDNS) return s; String s1;/* w ww . java 2 s. c o m*/ try { InetAddress inetaddress = InetAddress.getByName(s); s1 = inetaddress.getHostName().trim(); } catch (UnknownHostException unknownhostexception) { s1 = s; } return s1.toLowerCase(); } }