if (resolvers == null) { resolvers = new Hashtable();
if (resolvers == null) { resolvers = new Hashtable(); }  if (resolver == null) { try { if (resolver == null) { String[] server = new String[] { _dnsserver.toString() }; resolver = new ExtendedResolver(server);  Lookup.setDefaultResolver(resolver);  resolvers.put(_dnsserver.toString(), resolver); } } catch (UnknownHostException e) { throw new NetworkException("Can't add DnsServer", e); } }  try { String key = _dnsserver.toString();  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); }
  public static void addDnsServer(ProtocolAddress _dnsserver) throws NetworkException  {    if (resolvers == null)    {      resolvers = new Hashtable();    }    if (resolver == null)    {      try      {        if (resolver == null)        {          String[] server = new String[]{_dnsserver.toString()};          resolver = new ExtendedResolver(server);          Lookup.setDefaultResolver(resolver);          resolvers.put(_dnsserver.toString(), resolver);        }      }      catch (UnknownHostException e)      {        throw new NetworkException("Can't add DnsServer", e);      }    }    try    {      String key = _dnsserver.toString();      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);    }  }