支持,您在调用SDK域名解析方法时,可以选择需要解析的IP类型,下面以同步解析方法示例,其他解析方法以及其他SDK版本信息,具体请参考SDK开发手册。
无SDK使用时请参见IPv6服务调度接口 。
Android:
HttpDnsService httpdns = HttpDns.getService(applicationContext, accountID, secretKey);
HTTPDNSResult httpDnsResult = httpdns.getHttpDnsResultForHostSync("www.aliyun.com", RequestIpType.v6);
说明
2.4.0版本新增方法。
iOS:
HttpDnsService *httpDnsService = [HttpDnsService sharedInstance];
HttpdnsResult *result = [httpDnsService resolveHostSync:host byIpType:HttpdnsQueryIPTypeIpv6];
说明
3.0.0版本中新增方法。
Harmony:
httpdns.getService(ACCOUNT_ID).then((service) => {
// ************* 同步域名解析 begin *************
const result = service.getHttpDnsResultSyncNonBlocking(HOST, IpType.V6);
// ************* 同步域名解析 end *************
}).catch((e: HttpDnsError) => {
console.error(`失败 ${e.code} ${e.message}`);
});
文档内容是否对您有帮助?