Package org.xbill.DNS

Examples of org.xbill.DNS.ExtendedResolver


                getLogger().info("DNS Server is: " + serversArray[c]);
            }
        }

        try {
            resolver = new ExtendedResolver( serversArray );
            Lookup.setDefaultResolver(resolver);
        } catch (UnknownHostException uhe) {
            getLogger().fatalError("DNS service could not be initialized.  The DNS servers specified are not recognized hosts.", uhe);
            throw uhe;
        }
View Full Code Here


            getLogger().info("DNS Servers is: " + i.next());
        }

        //Create the extended resolver...
        final String serversArray[] = (String[])servers.toArray(new String[0]);
        resolver = new ExtendedResolver( serversArray );

        cache = new Cache (DClass.IN);

        getLogger().info("DNSServer ...init end");
    }
View Full Code Here

        DNSCacheManager clone = (DNSCacheManager) super.clone();
        clone.systemDefaultDnsResolver = new SystemDefaultDnsResolver();
        clone.cache = new LinkedHashMap<String, InetAddress[]>();
        CollectionProperty dnsServers = getServers();
        try {
            clone.resolver = new ExtendedResolver();
            PropertyIterator dnsServIt = dnsServers.iterator();
            while (dnsServIt.hasNext()) {
                String dnsServer = dnsServIt.next().getStringValue();
                ((ExtendedResolver) clone.resolver).addResolver(new SimpleResolver(dnsServer));
            }
View Full Code Here

                logger.info("DNS Server is: " + aServersArray);
            }
        }

        try {
            resolver = new ExtendedResolver(serversArray);
        } catch (UnknownHostException uhe) {
            logger.error("DNS service could not be initialized.  The DNS servers specified are not recognized hosts.", uhe);
            throw uhe;
        }
View Full Code Here

   * @param hostIp
   * @return The resolved DNS name.
   * @throws IOException
   */
  public static String resolveAddress(String hostIp) throws IOException {
    Resolver res = new ExtendedResolver();
    res.setTimeout(5); // seconds

    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 org.xbill.DNS.ExtendedResolver

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.