SystemDefaultDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return InetAddress.getAllByName(host); }  @Override InetAddress[] resolve(String host);  }
@Test public void testResolveLocalhost() throws Exception { DnsResolver resolver = new SystemDefaultDnsResolver(); assertNotNull(resolver.resolve("127.0.0.1")); assertEquals("Should resolve to 1 address", 1, resolver.resolve("127.0.0.1").length); assertTrue("Should resolve localhost", resolver.resolve("localhost").length > 0); }