Package com.dotcms.repackage.org.xbill.DNS

Examples of com.dotcms.repackage.org.xbill.DNS.Resolver


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
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.xbill.DNS.Resolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.