class DnsNamingService implements NamingService {

    @Override
    public List<ServiceInstance> lookup(SubscribeInfo subscribeInfo) {
        InetAddress[] addresses;
        try {
            addresses = InetAddress.getAllByName(host);
        } catch (UnknownHostException ex) {
            throw new IllegalArgumentException("unknown http host");
        }

        List<ServiceInstance> instances = new ArrayList<ServiceInstance>();
        for (InetAddress address : addresses) {
            ServiceInstance instance = new ServiceInstance(address.getHostAddress(), port);
            if (subscribeInfo != null && StringUtils.isNoneBlank(subscribeInfo.getServiceId())) {
                instance.setServiceName(subscribeInfo.getServiceId());
            }
            instances.add(instance);
        }
        return instances;
    }

    public  DnsNamingService(BrpcURL namingUrl);

}