@Override public List<ServiceCallServer> getUpdatedListOfServers(String name) { final Lookup lookup = lookupFactory.apply(name); final Record[] records = lookup.run(); List<ServiceCallServer> servers; if (Objects.nonNull(records) && lookup.getResult() == Lookup.SUCCESSFUL) { servers = Arrays.stream(records) .filter(SRVRecord.class::isInstance) .map(SRVRecord.class::cast) .sorted(DnsServiceCallServer.COMPARATOR) .map(DnsServiceCallServer::new) .collect(Collectors.toList()); } else { servers = Collections.emptyList(); } return servers; }
public static String resolve(String host, int addrType) { try { Lookup lookup = new Lookup(host, addrType); SimpleResolver resolver = new SimpleResolver("114.114.114.114"); resolver.setTimeout(5); lookup.setResolver(resolver); Record[] result = lookup.run(); if (result == null) return null; List<Record> records = java.util.Arrays.asList(result); java.util.Collections.shuffle(records); for (Record record : records) { if (addrType == Type.A) { return ((ARecord) record).getAddress().getHostAddress(); } else if (addrType == Type.AAAA) { return ((AAAARecord) record).getAddress().getHostAddress(); } } } catch (Exception ex) { return null; } return null; }
/** * reverse lookup an IP address using a specified DNS host and port * * @param resolverHost name server hostname or IP address * @param resolverPort name server port * @param address the IP address to reverse lookup * @return a comma separated list of names or an empty string when unable to resolve */ public String reverseLookupByAddress(String resolverHost, int resolverPort, InetAddress address) { try { SimpleResolver resolver = new SimpleResolver(resolverHost); resolver.setPort(resolverPort); Lookup lookup = new Lookup(fromAddress(address), PTR); Record[] records = lookup.run(); if (records != null) { List<String> addresses = of(records) .filter(it -> it instanceof PTRRecord) .map(it -> ((PTRRecord) it).getTarget().toString()) .collect(toList()); return collectionToCommaDelimitedString(addresses); } else { return ""; } } catch (UnknownHostException e) { log.warn("unable to resolve using SRV record " + address, e); return ""; } }
public static String reverseDNSLookup(final InetAddress adr) { try { final Name name = ReverseMap.fromAddress(adr); final Lookup lookup = new Lookup(name, Type.PTR); lookup.setResolver(new SimpleResolver()); lookup.setCache(null); final Record[] records = lookup.run(); if (lookup.getResult() == Lookup.SUCCESSFUL) for (final Record record : records) if (record instanceof PTRRecord) { final PTRRecord ptr = (PTRRecord) record; return ptr.getTarget().toString(); } } catch (final Exception e) { } return null; }
/** * Attempts to resolve an SMTP server address, given the destination e-mail address. * * @param email The e-mail address used for the lookup. * @return An optional, potentially containing */ protected Optional<String> resolve(String email) { Optional<String> domainOptional = extractDomain(email); if (!domainOptional.isPresent()) { return Optional.empty(); } String mailDomain = domainOptional.get(); try { Lookup dnsLookup = new Lookup(mailDomain, Type.MX); List<Record> records = Arrays.asList(dnsLookup.run()); if (records.isEmpty()) { return Optional.empty(); } return chooseBestRecord(records); } catch (TextParseException e) { e.printStackTrace(); } return Optional.empty(); }
@Override public List<SRVRecord> lookupSRVRecords(String name) throws TextParseException { List<SRVRecord> res = new ArrayList<SRVRecord>(); Lookup lookup = new Lookup(name, Type.SRV); Record[] recs = lookup.run(); if (recs == null) return res; for (Record record : recs) { org.xbill.DNS.SRVRecord srvRecord = (org.xbill.DNS.SRVRecord) record; if (srvRecord != null && srvRecord.getTarget() != null) { String host = srvRecord.getTarget().toString(); int port = srvRecord.getPort(); int priority = srvRecord.getPriority(); int weight = srvRecord.getWeight(); SRVRecord r = new SRVRecord(host, port, priority, weight); res.add(r); } } return res; }
/** * resolves an A record by its name using a specified DNS host and port * * @param resolverHost name server hostname or IP address * @param resolverPort name server port * @param name the DNS name of the A record - the name to resolve * @return a comma separated list of IP addresses or an empty string when unable to resolve */ public String resolveHostByName(String resolverHost, int resolverPort, String name) { try { SimpleResolver resolver = new SimpleResolver(resolverHost); resolver.setPort(resolverPort); Lookup lookup = new Lookup(name, A); Record[] records = lookup.run(); if (records != null) { List<String> addresses = of(records) .filter(it -> it instanceof ARecord) .map(it -> ((ARecord) it).getAddress().getHostAddress()) .collect(toList()); return collectionToCommaDelimitedString(addresses); } else { return ""; } } catch (UnknownHostException | TextParseException e) { log.warn("unable to resolve using A record " + name, e); return ""; } }
/** * resolves the TXT field for a given name using a specified DNS host and port. This is useful, for example, * if you want to resolve abusers with: <a href="https://abusix.com/contactdb.html">https://abusix.com/contactdb.html</a> * * @param resolverHost name server hostname or IP address * @param resolverPort name server port * @param name the DNS name of the TXT record - the name to resolve * @return the resolved text */ public String resolveTextByName(String resolverHost, int resolverPort, String name) { try { SimpleResolver resolver = new SimpleResolver(resolverHost); resolver.setPort(resolverPort); Lookup lookup = new Lookup(name, TXT); Record[] records = lookup.run(); if (records != null) { List<String> addresses = of(records) .filter(it -> it instanceof TXTRecord) .map(it -> collectionToCommaDelimitedString(((TXTRecord) it).getStrings())) .collect(toList()); return collectionToCommaDelimitedString(addresses); } else { return ""; } } catch (UnknownHostException | TextParseException e) { log.warn("unable to resolve using TXT record " + name, e); return ""; } }
private String resolveSrvByName(Resolver resolver, String name) { try { Lookup lookup = new Lookup(name, SRV); if (resolver != null) { lookup.setResolver(resolver); } Record[] records = lookup.run(); if (records == null) { return null; } return of(records) .filter(it -> it instanceof SRVRecord) .map(srv -> resolveHostByName(resolver, ((SRVRecord) srv).getTarget()) + ":" + ((SRVRecord) srv).getPort()) .distinct() .collect(joining(",")); } catch (TextParseException e) { log.warn("unable to resolve using SRV record " + name, e); return null; } }
private String resolveHostByName(Resolver resolver, Name target) { Lookup lookup = new Lookup(target, A); if (resolver != null) { lookup.setResolver(resolver); } Record[] records = lookup.run(); Optional<InetAddress> address = of(records) .filter(it -> it instanceof ARecord) .map(a -> ((ARecord) a).getAddress()) .findFirst(); if (address.isPresent()) { return address.get().getHostAddress(); } else { log.warn("unknown name: " + target); return null; } }
/** * Validate the DNS <code>Lookup</code>, catching any transient or blocking issue. * * @param lookup A <code>Lookup</code> used to pull Resource Records * * @return A <code>StatusCode</code> with the check outcome * * @throws LookupException * Containing the specific <code>StatusCode</code> defining the error that has been raised. */ public static StatusCode checkLookupStatus(Lookup lookup) throws LookupException { StatusCode outcome = null; if (lookup.getResult() == Lookup.TRY_AGAIN) { outcome = StatusCode.NETWORK_ERROR; } else if (lookup.getResult() == Lookup.UNRECOVERABLE) { outcome = StatusCode.SERVER_ERROR; } else if (lookup.getResult() == Lookup.HOST_NOT_FOUND) { // Domain Name not found outcome = StatusCode.RESOLUTION_NAME_ERROR; } else if (lookup.getResult() == Lookup.TYPE_NOT_FOUND) { // RR set not found outcome = StatusCode.RESOLUTION_RR_TYPE_ERROR; } else { outcome = StatusCode.SUCCESSFUL_OPERATION; } return outcome; }
@Override public List<LookupResult> resolve(final String fqdn) { Lookup lookup = lookupFactory.forName(fqdn); Record[] queryResult = lookup.run(); switch (lookup.getResult()) { case Lookup.SUCCESSFUL: return toLookupResults(queryResult); case Lookup.HOST_NOT_FOUND: // fallthrough case Lookup.TYPE_NOT_FOUND: LOG.warn("No results returned for query '{}'; result from XBill: {} - {}", fqdn, lookup.getResult(), lookup.getErrorString()); return ImmutableList.of(); default: throw new DnsException( String.format("Lookup of '%s' failed with code: %d - %s ", fqdn, lookup.getResult(), lookup.getErrorString())); } }
@Test() public void testNoMxRecords() throws MxLookupException { new Expectations() { { lookup.run(); result = null; lookup.getResult(); result = Lookup.TYPE_NOT_FOUND; } }; Name[] targets = mxLookup.queryMxTargets(EXAMPLE_COM_DOMAIN); assertArrayEquals(new Name[] { EXAMPLE_COM_NAME }, targets); }
@Test public void testTransientDnsFailure() { new Expectations() { { lookup.run(); result = null; lookup.getResult(); result = Lookup.TRY_AGAIN; } }; SendException e; try { addressLookup.queryAddresses(HOST1_EXAMPLE_COM_NAME); fail("An exception must have been thrown."); return; } catch (SendException e1) { e = e1; } assertTrue(e.errorStatus().shouldRetry()); }
private void init() { if (mInitialized) return; else mInitialized = true; try { // configure the resolvers, starting with the default ones (based on the current network connection) Resolver defaultResolver = Lookup.getDefaultResolver(); // use Google's public DNS services Resolver googleFirstResolver = new SimpleResolver("8.8.8.8"); Resolver googleSecondResolver = new SimpleResolver("8.8.4.4"); // also try using Amazon Resolver amazonResolver = new SimpleResolver("205.251.198.30"); Lookup.setDefaultResolver(new ExtendedResolver(new Resolver[]{ googleFirstResolver, googleSecondResolver, amazonResolver, defaultResolver })); } catch (UnknownHostException e) { Log.w(TAG, "Couldn't initialize custom resolvers"); } }
@Test public void testDnsJavaWithDnsServer() throws TextParseException, UnknownHostException { final Lookup l = new Lookup("example.com", Type.AAAA); final SimpleResolver resolver = new SimpleResolver("::1"); resolver.setPort(9153); l.setResolver(resolver); l.run(); System.out.println("result: " + l.getResult()); final Record[] answers = l.getAnswers(); assertEquals(answers.length, 1); final Record record = answers[0]; System.err.println(record.getTTL()); if(l.getResult() == Lookup.SUCCESSFUL) { System.out.println(l.getAnswers()[0].rdataToString()); } assertTrue(l.getResult() == Lookup.SUCCESSFUL); }
@Test @JUnitDNSServer(port=9153, zones={}) public void testNoAnswer() throws Exception { final Lookup l = new Lookup("example.com", Type.AAAA); final SimpleResolver resolver = new SimpleResolver("::1"); resolver.setPort(9153); l.setResolver(resolver); l.run(); System.out.println("result: " + l.getResult()); final Record[] answers = l.getAnswers(); assertNotNull(answers); assertEquals(answers.length, 1); final Record record = answers[0]; System.err.println(record.getTTL()); if(l.getResult() == Lookup.SUCCESSFUL) { System.out.println(l.getAnswers()[0].rdataToString()); } assertTrue(l.getResult() == Lookup.SUCCESSFUL); }
public static List<ForwardLookupResult> getARecord(String hostName, String domainName) throws TextParseException { List<ForwardLookupResult> entries = null; if (hostName != null && !hostName.isEmpty() && domainName != null && !domainName.isEmpty()) { Record[] recs = new Lookup(hostName, Type.A).run(); if (recs != null) { if (recs.length > 0) { entries = new ArrayList<>(); for (Record record : recs) { ForwardLookupResult foundSubDomain = new ForwardLookupResult(domainName); foundSubDomain.setHostName(hostName); String ipAddress = ((ARecord) record).getAddress().getHostAddress(); foundSubDomain.setIpAddress(ipAddress); foundSubDomain.setLookupType("A"); entries.add(foundSubDomain); } } } } return entries; }
public static List<ForwardLookupResult> getAAAARecord(String hostName, String domainName) throws TextParseException { List<ForwardLookupResult> entries = null; if (hostName != null && !hostName.isEmpty() && domainName != null && !domainName.isEmpty()) { Record[] recs = new Lookup(hostName, Type.AAAA).run(); if (recs != null) { if (recs.length > 0) { entries = new ArrayList<>(); for (Record record : recs) { ForwardLookupResult foundSubDomain = new ForwardLookupResult(domainName); foundSubDomain.setHostName(hostName); String ipAddress = ((AAAARecord) record).getAddress().getHostAddress(); foundSubDomain.setIpAddress(ipAddress); foundSubDomain.setLookupType("A"); entries.add(foundSubDomain); } } } } return entries; }
public static List<ARecordResult> getARecord(String hostName) throws TextParseException { List<ARecordResult> entries = null; Record[] recs = new Lookup(hostName, Type.A).run(); if (recs != null) { if (recs.length > 0) { entries = new ArrayList<>(); for (Record record : recs) { ARecordResult foundSubDomain = new ARecordResult(NetworkTools.getDomainFromHost(hostName)); foundSubDomain.setHostName(hostName); String ipAddress = ((ARecord) record).getAddress().getHostAddress(); foundSubDomain.setIpAddress(ipAddress); foundSubDomain.setLookupType("A"); entries.add(foundSubDomain); } } } return entries; }
public static String getDomainFromHost(String host) { String tmpHost = host; if (host.isEmpty()) { return ""; } while (true) { try { if (!tmpHost.startsWith("www.")) { Record[] recs = new Lookup(tmpHost, Type.SOA).run(); if (recs != null) { return tmpHost; } } if (tmpHost.contains(".")) { tmpHost = tmpHost.split("\\.", 2)[1]; } else { break; } } catch (TextParseException ex) { Logger.getLogger("networkTools.getDomainFromHost").log(Level.SEVERE, null, ex); break; } } return ""; }
public List<ARecordResult> getARecord(String hostName) throws TextParseException { List<ARecordResult> entries = null; Record[] recs = new Lookup(hostName, Type.A).run(); if (recs != null) { if (recs.length > 0) { entries = new ArrayList<>(); for (Record record : recs) { ARecordResult foundSubDomain = new ARecordResult(NetworkTools.getDomainFromHost(hostName)); foundSubDomain.setHostName(hostName); String ipAddress = ((ARecord) record).getAddress().getHostAddress(); foundSubDomain.setIpAddress(ipAddress); foundSubDomain.setLookupType("A"); entries.add(foundSubDomain); } } } return entries; }
@Test public void testDNameWithNoCnameIsValid() throws IOException { Message m = resolver.send(createMessage("www.isc.ingotronic.ch./A")); Message message = messageFromString(m.toString().replaceAll("(.*CNAME.*)", "").replaceAll("\n\n", "\n")); add("www.isc.ingotronic.ch./A", message); Message response = resolver.send(createMessage("www.isc.ingotronic.ch./A")); assertTrue("AD flag must be set", response.getHeader().getFlag(Flags.AD)); assertEquals(Rcode.NOERROR, response.getRcode()); assertNull(getReason(response)); Lookup l = new Lookup("www.isc.ingotronic.ch"); l.setResolver(resolver); Record[] results = l.run(); assertTrue(results != null); assertTrue(results.length >= 1); }
protected void setUp() throws Exception { dnsServer = new TestableDNSServer(); DefaultConfigurationBuilder db = new DefaultConfigurationBuilder(); db.load(new ByteArrayInputStream("<dnsserver><autodiscover>true</autodiscover><authoritative>false</authoritative></dnsserver>".getBytes())); dnsServer.setLog(LoggerFactory.getLogger("MockLog")); dnsServer.configure(db); dnsServer.init(); defaultCache = Lookup.getDefaultCache(DClass.IN); defaultResolver = Lookup.getDefaultResolver(); defaultSearchPaths = Lookup.getDefaultSearchPath(); Lookup.setDefaultCache(null, DClass.IN); Lookup.setDefaultResolver(null); Lookup.setDefaultSearchPath(new Name[] {}); }
@Test @JUnitDNSServer(port=9153, zones={}) public void testNoAnswer() throws Exception { final Lookup l = new Lookup("example.com", Type.AAAA); final SimpleResolver resolver = new SimpleResolver("::1"); resolver.setPort(9153); l.setResolver(resolver); l.run(); System.out.println("result: " + l.getResult()); final Record[] answers = l.getAnswers(); assertEquals(answers.length, 1); final Record record = answers[0]; System.err.println(record.getTTL()); if(l.getResult() == Lookup.SUCCESSFUL) { System.out.println(l.getAnswers()[0].rdataToString()); } assertTrue(l.getResult() == Lookup.SUCCESSFUL); }
public static Long getASN(final InetAddress adr) { try { final Name postfix; if (adr instanceof Inet6Address) postfix = Name.fromConstantString("origin6.asn.cymru.com"); else postfix = Name.fromConstantString("origin.asn.cymru.com"); final Name name = getReverseIPName(adr, postfix); System.out.println("lookup: " + name); final Lookup lookup = new Lookup(name, Type.TXT); lookup.setResolver(new SimpleResolver()); lookup.setCache(null); final Record[] records = lookup.run(); if (lookup.getResult() == Lookup.SUCCESSFUL) for (final Record record : records) if (record instanceof TXTRecord) { final TXTRecord txt = (TXTRecord) record; @SuppressWarnings("unchecked") final List<String> strings = txt.getStrings(); if (strings != null && !strings.isEmpty()) { final String result = strings.get(0); final String[] parts = result.split(" ?\\| ?"); if (parts != null && parts.length >= 1) return new Long(parts[0].split(" ")[0]); } } } catch (final Exception e) { } return null; }
public static String getASName(final long asn) { try { final Name postfix = Name.fromConstantString("asn.cymru.com."); final Name name = new Name(String.format("AS%d", asn), postfix); System.out.println("lookup: " + name); final Lookup lookup = new Lookup(name, Type.TXT); lookup.setResolver(new SimpleResolver()); lookup.setCache(null); final Record[] records = lookup.run(); if (lookup.getResult() == Lookup.SUCCESSFUL) for (final Record record : records) if (record instanceof TXTRecord) { final TXTRecord txt = (TXTRecord) record; @SuppressWarnings("unchecked") final List<String> strings = txt.getStrings(); if (strings != null && !strings.isEmpty()) { System.out.println(strings); final String result = strings.get(0); final String[] parts = result.split(" ?\\| ?"); if (parts != null && parts.length >= 1) return parts[4]; } } } catch (final Exception e) { } return null; }
public static String getAScountry(final long asn) { try { final Name postfix = Name.fromConstantString("asn.cymru.com."); final Name name = new Name(String.format("AS%d", asn), postfix); System.out.println("lookup: " + name); final Lookup lookup = new Lookup(name, Type.TXT); lookup.setResolver(new SimpleResolver()); lookup.setCache(null); final Record[] records = lookup.run(); if (lookup.getResult() == Lookup.SUCCESSFUL) for (final Record record : records) if (record instanceof TXTRecord) { final TXTRecord txt = (TXTRecord) record; @SuppressWarnings("unchecked") final List<String> strings = txt.getStrings(); if (strings != null && !strings.isEmpty()) { final String result = strings.get(0); final String[] parts = result.split(" ?\\| ?"); if (parts != null && parts.length >= 1) return parts[1]; } } } catch (final Exception e) { } return null; }
/** * Sends DNS request via system or custom DNS resolver */ private InetAddress[] requestLookup(String host) throws UnknownHostException { InetAddress[] addresses = null; if (isCustomResolver() && ((ExtendedResolver) resolver).getResolvers().length > 0) { try { Lookup lookup = new Lookup(host, Type.A); lookup.setCache(lookupCache); if (timeoutMs > 0) { resolver.setTimeout(timeoutMs / 1000, timeoutMs % 1000); } lookup.setResolver(resolver); Record[] records = lookup.run(); if (records == null || records.length == 0) { throw new UnknownHostException("Failed to resolve host name: " + host); } addresses = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) { addresses[i] = ((ARecord) records[i]).getAddress(); } } catch (TextParseException tpe) { log.debug("Failed to create Lookup object: " + tpe); } } else { addresses = systemDefaultDnsResolver.resolve(host); if (log.isDebugEnabled()) { log.debug("Cache miss: " + host + " Thread #" + JMeterContextService.getContext().getThreadNum() + ", resolved with system resolver into " + Arrays.toString(addresses)); } } return addresses; }
@Override public void process(Exchange exchange) throws Exception { String dnsName = exchange.getIn().getHeader(DnsConstants.DNS_NAME, String.class); ObjectHelper.notEmpty(dnsName, "Header " + DnsConstants.DNS_NAME); Object type = exchange.getIn().getHeader(DnsConstants.DNS_TYPE); Integer dnsType = null; if (type != null) { dnsType = Type.value(String.valueOf(type)); } Object dclass = exchange.getIn().getHeader(DnsConstants.DNS_CLASS); Integer dnsClass = null; if (dclass != null) { dnsClass = DClass.value(String.valueOf(dclass)); } Lookup lookup = (dnsClass == null) ? (dnsType == null ? new Lookup(dnsName) : new Lookup(dnsName, dnsType)) : new Lookup(dnsName, dnsType, dnsClass); lookup.run(); if (lookup.getAnswers() != null) { exchange.getIn().setBody(lookup.getAnswers()); } else { throw new CamelException(lookup.getErrorString()); } }
@Override public Lookup apply(String name) { Lookup lookup = cache.get(name); if (lookup == null) { synchronized (cache) { lookup = cache.computeIfAbsent(name, this::createLookup); } } return lookup; }
private Lookup createLookup(String name) { try { return new Lookup( String.format("%s.%s.%s", name, configuration.getProto(), configuration.getDomain()), Type.SRV); } catch (TextParseException e) { throw new RuntimeCamelException(e); } }
/** * Performs a reverse DNS lookup. * @param addr The ip address to lookup. * @return The host name found for the ip address. */ public String getHostByAddr(byte [] addr) throws UnknownHostException { Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr)); Record [] records = new Lookup(name, Type.PTR).run(); if (records == null) throw new UnknownHostException(); return ((PTRRecord) records[0]).getTarget().toString(); }
private Lookup buildLookup() throws TextParseException, UnknownHostException { ExtendedResolver resolver = new ExtendedResolver(); resolver.setTimeout(serviceDnsTimeout); Lookup lookup = new Lookup(serviceDns, Type.SRV); lookup.setResolver(resolver); // Avoid caching temporary DNS lookup failures indefinitely in global cache lookup.setCache(null); return lookup; }
private void testValidServiceDns(final int port, final int expectedPort) throws Exception { DnsEndpointResolver endpointResolver = PowerMockito.spy(new DnsEndpointResolver(LOGGER, "hazelcast.com", port, SERVICE_DNS_TIMEOUT)); PowerMockito.when(endpointResolver, MemberMatcher.method(DnsEndpointResolver.class, "buildLookup")).withNoArguments().thenReturn(lookup); when(lookup.getResult()).thenReturn(Lookup.SUCCESSFUL); when(lookup.run()).thenReturn(getRecords()); List<DiscoveryNode> nodes = endpointResolver.resolve(); assertEquals(1, nodes.size()); assertEquals("127.0.0.1", nodes.get(0).getPrivateAddress().getHost()); assertEquals(expectedPort, nodes.get(0).getPrivateAddress().getPort()); }
@Test public void testDnsFailFlow() throws Exception { DnsEndpointResolver endpointResolver = PowerMockito.spy(new DnsEndpointResolver(LOGGER, "hazelcast.com", 0, SERVICE_DNS_TIMEOUT)); PowerMockito.when(endpointResolver, MemberMatcher.method(DnsEndpointResolver.class, "buildLookup")).withNoArguments().thenReturn(lookup); when(lookup.getResult()).thenReturn(Lookup.HOST_NOT_FOUND); when(lookup.run()).thenReturn(getRecords()); List<DiscoveryNode> nodes = endpointResolver.resolve(); assertTrue(nodes.isEmpty()); verify(lookup).run(); verify(lookup).getResult(); verify(lookup).getErrorString(); }
/** * Performs a reverse DNS lookup. * * @param addr * The ip address to lookup. * @return The host name found for the ip address. */ public String getHostByAddr(byte[] addr) throws UnknownHostException { Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr)); Record[] records = new Lookup(name, Type.PTR).run(); if (records == null) throw new UnknownHostException(); return ((PTRRecord) records[0]).getTarget().toString(); }
@Override public Lookup forName(String fqdn) { try { return new Lookup(fqdn, Type.SRV, DClass.IN); } catch (TextParseException e) { throw new DnsException("unable to create lookup for name: " + fqdn, e); } }