code: protected void doResolve(String inetHost,
                               DnsRecord[] additionals,
                               Promise<InetAddress> promise,
                               DnsCache resolveCache) throws Exception {
          if (inetHost == null || inetHost.isEmpty()) {
              // If an empty hostname is used we should use "localhost", just like InetAddress.getByName(...) does.
              promise.setSuccess(loopbackAddress());
              return;
          }
          final byte[] bytes = NetUtil.createByteArrayFromIpAddressString(inetHost);
          if (bytes != null) {
              // The inetHost is actually an ipaddress.
              promise.setSuccess(InetAddress.getByAddress(bytes));
              return;
          }
  
          final String hostname = hostname(inetHost);
  
          InetAddress hostsFileEntry = resolveHostsFileEntry(hostname);
          if (hostsFileEntry != null) {
              promise.setSuccess(hostsFileEntry);
              return;
          }
  
          if (!doResolveCached(hostname, additionals, promise, resolveCache)) {
              doResolveUncached(hostname, additionals, promise, resolveCache, true);
          }
      }
docs: Hook designed for extensibility so one can pass a different cache on each resolution attempt
  instead of using the global one.