* HTTPDNS' sync DNS API
* The cache is queried first. If the cache is hit, the result will be returned; otherwise, a sync DNS request will be sent
* The latest DNS query result will be returned after the query is completed
* The returned value string will be separated by semicolon, with the resolved IPv4 address ("0" if DNS query fails) before the semicolon and the resolved IPv6 address ("0" if DNS fails) after it
* Sample response: 121.14.77.221;2402:4e00:1020:1404:0:9227:71a3:83d2
* @param domain Domain (such as www.qq.com)
* @return Set of resolved IP results that correspond to the domain
*/
String ips = MSDKDnsResolver.getInstance().getAddrByName(domain);
* HTTPDNS' batch sync DNS API
* The cache is queried first. If the cache is hit, the result will be returned; otherwise, a sync DNS request will be sent
* The latest DNS query result will be returned after the query is completed
* The returned value `ipSet` is the set of resolved IP addresses
* `ipSet.v4Ips` is the set of resolved IPv4 addresses, which may be `null`
* `ipSet.v6Ips` is the set of resolved IPv6 addresses, which may be `null`
* Sample response for a single domain: IpSet{v4Ips=[121.14.77.201, 121.14.77.221], v6Ips=[2402:4e00:1020:1404:0:9227:71ab:2b74, 2402:4e00:1020:1404:0:9227:71a3:83d2], ips=null}
* Sample response for multiple domains: IpSet{v4Ips=[www.baidu.com:14.215.177.39, www.baidu.com:14.215.177.38, www.youtube.com:104.244.45.246], v6Ips=[www.youtube.com.:2001::1f0:5610], ips=null}
* @param domain Multiple domains can be separated by comma, such as `qq.com,baidu.com`
* @return Set of resolved IP results that correspond to the domain
*/
Ipset ips = MSDKDnsResolver.getInstance().getAddrsByName(domain);
Was this page helpful?