##### Coverage Report - com.ctrip.apollo.core.utils.DNSUtil

Classes in this File | Line Coverage | Branch Coverage | Complexity
DNSUtil |
0% | 0/7
0% | 0/4
| 3.0;3

1 |  |
     package com.ctrip.apollo.core.utils;
2 |  |
3 |  |
     import java.net.InetAddress;
4 |  |
     import java.net.UnknownHostException;
5 |  |
     import java.util.ArrayList;
6 |  |
     import java.util.List;
7 |  |
8 | 0 |
     public class DNSUtil {
9 |  |
10 |  |
       public static List<String> resolve(String domainName) throws UnknownHostException {
11 | 0 |
         List<String> result = new ArrayList<String>();
12 |  |
13 | 0 |
         InetAddress[] addresses = InetAddress.getAllByName(domainName);
14 | 0 |
         if (addresses != null) {
15 | 0 |
           for (InetAddress addr : addresses) {
16 | 0 |
             result.add(addr.getHostAddress());
17 |  |
           }
18 |  |
         }
19 |  |
20 | 0 |
         return result;
21 |  |
       }
22 |  |
23 |  |
     }