@Override
    public ClientBuilder dnsServerAddresses(List<InetSocketAddress> addresses) {
        for (InetSocketAddress address : addresses) {
            String ip = address.getHostString();
            checkArgument(InetAddressUtils.isIPv4Address(ip) || InetAddressUtils.isIPv6Address(ip),
                    "DnsServerAddresses need to be valid IPv4 or IPv6 addresses");
        }
        conf.setDnsServerAddresses(addresses);
        return this;
    }
@Test(expectedExceptions = IllegalArgumentException.class)
    public void testClientBuilderWithIllegalDNSServerHostname() throws PulsarClientException {
        PulsarClient.builder().dnsServerAddresses(
                Arrays.asList(new InetSocketAddress("1.2.3.4", 53), new InetSocketAddress("localhost",53)));
    }