private static Allocation ofIpv4(String ipAddress, NameResolver resolver) {
            String hostname4 = resolver.resolveHostname(ipAddress).orElseThrow(() -> new IllegalArgumentException("Could not resolve IP address: " + ipAddress));
            List<String> addresses = resolver.resolveAll(hostname4).stream()
                                             .filter(IP::isV4)
                                             .toList();
            if (addresses.size() != 1) {
                throw new IllegalArgumentException("Hostname " + hostname4 + " did not resolve to exactly 1 address. " +
                                                   "Resolved: " + addresses);
            }
            return new Allocation(hostname4, Optional.of(addresses.get(0)), Optional.empty());
        }
Allocate an IPv4 address. A successful allocation is guaranteed to have an IPv4 address.

@param ipAddress Unassigned IPv4 address
@param resolver DNS name resolver to use
@return An allocation containing 1 IPv4 address.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/IP.java