Package org.xbill.DNS

Examples of org.xbill.DNS.SimpleResolver


        _cacheMisses++;

        try {

          SimpleResolver resolver = new SimpleResolver(_dnsServerAddress);
          // allocate a simple resolver object ...
          //NIODNSSimpleResolverImpl resolver = new NIODNSSimpleResolverImpl(this, _dnsServerAddress);

          // use tcp if requested ...
          if (useTCP)
            resolver.setTCP(true);

          // set the timeout ...
          resolver.setTimeout(timeoutValue);

          // create appropriate data structures ...
          Name name = Name.fromString(hostName, Name.root);
          Record rec = Record.newRecord(name, Type.A, DClass.IN);
          Message query = Message.newQuery(rec);

          // send it off ...
          try {
            response = resolver.send(query);
          } catch (IOException e) {
            if (_logger != null)
              _logger.logDNSException(hostName, StringUtils
                  .stringifyException(e));
View Full Code Here


   
    resolvers = new Resolver[nameservers.length];
    for(int i = 0 ; i < resolvers.length; ++i)
    {
      try {
        resolvers[i] = new SimpleResolver(nameservers[i]);
        resolvers[i].setTimeout(timeoutSecs);
      } catch (UnknownHostException e) {
        throw new RuntimeException("Could not initial resolver for host="+nameservers[i]);
      }
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    protected DNSService getDNSServiceFakeServer() {
        Resolver resolver = null;
        try {
            resolver = new SimpleResolver("127.0.0.1");
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        resolver.setPort(FAKE_SERVER_PORT);
View Full Code Here

        try {
            clone.resolver = new ExtendedResolver();
            PropertyIterator dnsServIt = dnsServers.iterator();
            while (dnsServIt.hasNext()) {
                String dnsServer = dnsServIt.next().getStringValue();
                ((ExtendedResolver) clone.resolver).addResolver(new SimpleResolver(dnsServer));
            }
            // resolvers will be chosen via round-robin
            ((ExtendedResolver) clone.resolver).setLoadBalance(true);
        } catch (UnknownHostException uhe) {
            log.warn("Failed to create Extended resolver: " + uhe.getMessage());
View Full Code Here

    String applicationFqdn = String.format("_%s._%s.%s",
        applicationId.toLowerCase(), transportProtocol.toLowerCase(),
        authoritativeFqdn);

    SimpleResolver resolver;
    try {
      if (mDNSHostname == null) {
        resolver = new SimpleResolver();
      } else {
        resolver = new SimpleResolver(mDNSHostname);
      }
    } catch (UnknownHostException e) {
      throw new LookupException("Error creating DNS Resolver", e);
    }
View Full Code Here

   * @return      Authoritative FQDN String
   * @throws LookupException
   */
  String resolveAuthoritativeFQDN() throws LookupException {
    try {
      SimpleResolver resolver;
      if (mDNSHostname == null) {
        resolver = new SimpleResolver();
      } else {
        resolver = new SimpleResolver(mDNSHostname);
      }
      Lookup lookup = new Lookup(getRadioDNSFqdn(), Type.CNAME);
      lookup.setResolver(resolver);
      org.xbill.DNS.Record[] records = lookup.run();

View Full Code Here

     * @return a dns resolver pointing to the local fake server
     */
    protected DNSService getDNSServiceFakeServer() {
        Resolver resolver = null;
        try {
            resolver = new SimpleResolver("127.0.0.1");
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        resolver.setPort(FAKE_SERVER_PORT);
View Full Code Here

     * @return a dns resolver pointing to the local fake server
     */
    protected DNSService getDNSServiceFakeServer() {
        Resolver resolver = null;
        try {
            resolver = new SimpleResolver("127.0.0.1");
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        resolver.setPort(FAKE_SERVER_PORT);
View Full Code Here

   * @param aResolver The resolver to use
   * @throws DnsSdDiscoveryException if hostname cannot be resolved
   */
  public void setResolver(String aResolver) {
    try {
      resolver = new SimpleResolver(aResolver);
    } catch (UnknownHostException e) {
      throw new DnsSdDiscoveryException(e);
    }
  }
View Full Code Here

    }
   
    // instantiate a default resolver
    if(resolver == null) {
      try {
        resolver = new SimpleResolver();
      } catch (UnknownHostException e) {
        throw new ContainerConnectException(e);
      }
    }
   
View Full Code Here

TOP

Related Classes of org.xbill.DNS.SimpleResolver

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.