import com.dotcms.repackage.org.xbill.DNS.Type;
public class DNSUtil {
public static String reverseDns(String hostIp) throws IOException {
Record opt = null;
Resolver res = new ExtendedResolver();
res.setTimeout(10);
Name name = ReverseMap.fromAddress(hostIp);
int type = Type.PTR;
int dclass = DClass.IN;
Record rec = Record.newRecord(name, type, dclass);
Message query = Message.newQuery(rec);
Message response = res.send(query);
Record[] answers = response.getSectionArray(Section.ANSWER);
if (answers.length == 0)
return hostIp;
else