产品动态
产品公告
// 获取到CosXmlServicecosXmlService.addCustomerDNSFetch(hostname -> {String ips = MSDKDnsResolver.getInstance().getAddrByName(hostname);String[] ipArr = ips.split(";");if (0 == ipArr.length) {return Collections.emptyList();}List<InetAddress> inetAddressList = new ArrayList<>(ipArr.length);for (String ip : ipArr) {if ("0".equals(ip)) {continue;}try {InetAddress inetAddress = InetAddress.getByName(ip);inetAddressList.add(inetAddress);} catch (UnknownHostException ignored) {}}return inetAddressList;});
pod 'QCloudCore/DNSLoader' // DNSLoader 模块,内部已封装腾讯 HTTPDNS
#import "QCloudHTTPDNSLoader.h"@property (nonatomic,strong)QCloudHTTPDNSLoader * dnsloader;
QCloudDnsConfig config;config.appId = @"******"; // 可选,应用 ID,腾讯云控制台申请获得,用于灯塔数据上报(未集成灯塔时该参数无效)config.dnsIp = @"0.0.0.0"; // HTTPDNS 服务器 IPconfig.dnsId = 1; // 授权 ID,腾讯云控制台申请后,通过邮件发送,用于域名解析鉴权config.dnsKey = @"*******";// des 的密钥config.encryptType = QCloudHttpDnsEncryptTypeDES; // 控制加密方式config.debug = YES; // 是否开启 Debug 日志,YES:开启,NO:关闭。建议联调阶段开启,正式上线前关闭config.timeout = 5000; // 可选,超时时间,单位ms,如设置0,则设置为默认值2000msself.dnsloader = [[QCloudHTTPDNSLoader alloc] initWithConfig:config];[QCloudHttpDNS shareDNS].delegate = self.dnsloader;
文档反馈