public Builder ipAddress(
        final String hostField, final EnodeDnsConfiguration enodeDnsConfiguration) {
      if (enodeDnsConfiguration.dnsEnabled()) {
        try {
          this.ip = InetAddress.getByName(hostField);
          if (enodeDnsConfiguration.updateEnabled()) {
            if (this.ip.isLoopbackAddress()) {
              this.ip = InetAddress.getLocalHost();
            }
            this.maybeHostname = Optional.of(this.ip.getHostName());
          }
        } catch (final UnknownHostException e) {
          if (!enodeDnsConfiguration.updateEnabled()) {
            throw new IllegalArgumentException("Invalid ip address or hostname.");
          } else {
            this.ip = InetAddresses.forString("127.0.0.1");
          }
        }
      } else if (InetAddresses.isUriInetAddress(hostField)) {
        this.ip = InetAddresses.forUriString(hostField);
      } else if (InetAddresses.isInetAddress(hostField)) {
        this.ip = InetAddresses.forString(hostField);
      } else {
        throw new IllegalArgumentException("Invalid ip address.");
      }
      return this;
    }
Get IP of the EnodeURL

<p>If "dns" and "dns-update" are enabled -&gt; DNS lookup every time to have the IP up to date
and not to rely on an invalid cache

<p>If the "dns" is enabled but "dns-update" is disabled -&gt; IP is retrieved only one time and
the hostname is no longer stored (maybeHostname is empty).

@return ip
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/peers/EnodeURLImpl.java