resolver = new ExtendedResolver();
String[] server = new String[]{_dnsserver.toString()}; resolver = new ExtendedResolver(server); System.out.println(resolver.getResolvers().length);
  public static void addDnsServer(ProtocolAddress _dnsserver) throws NetworkException  {    if (resolver == null)    {      try      {        //        resolver = (ExtendedResolver) Lookup.getDefaultResolver();        if (resolver == null)        {          resolver = new ExtendedResolver();          Lookup.setDefaultResolver(resolver);        }      }      catch (UnknownHostException e)      {        throw new NetworkException("Can't add DnsServer", e);      }    }    try    {      String key = _dnsserver.toString();      if (resolvers == null)      {        resolvers = new Hashtable();      }      if (!resolvers.containsKey(key))      {        SimpleResolver simpleResolver = new SimpleResolver(key);        resolver.addResolver(simpleResolver);        resolvers.put(key, simpleResolver);      }    }    catch (UnknownHostException e)    {      throw new NetworkException("Can't add DnsServer", e);    }  }