code: protected void doResolveAll(String inetHost,
                                  DnsRecord[] additionals,
                                  Promise<List<InetAddress>> promise,
                                  DnsCache resolveCache) throws Exception {
          if (inetHost == null || inetHost.isEmpty()) {
              // If an empty hostname is used we should use "localhost", just like InetAddress.getAllByName(...) does.
              promise.setSuccess(Collections.singletonList(loopbackAddress()));
              return;
          }
          final byte[] bytes = NetUtil.createByteArrayFromIpAddressString(inetHost);
          if (bytes != null) {
              // The unresolvedAddress was created via a String that contains an ipaddress.
              promise.setSuccess(Collections.singletonList(InetAddress.getByAddress(bytes)));
              return;
          }
  
          final String hostname = hostname(inetHost);
  
          InetAddress hostsFileEntry = resolveHostsFileEntry(hostname);
          if (hostsFileEntry != null) {
              promise.setSuccess(Collections.singletonList(hostsFileEntry));
              return;
          }
  
          if (!doResolveAllCached(hostname, additionals, promise, resolveCache, resolvedInternetProtocolFamilies)) {
              doResolveAllUncached(hostname, additionals, promise, resolveCache, false);
          }
      }
docs: Hook designed for extensibility so one can pass a different cache on each resolution attempt
  instead of using the global one.