HTTPDNS 库 Objdctive-C 实现(使用DNSPod 、AliyunDNS、 Google ...)
HTTPDNS 库 Objdctive-C 实现。
支持 DNSPod、DNSPod 企业版、AliYunDNS、Google 等(方便扩展)
在 Podfile
中添加:
platform :ios, '8.0'
pod 'HTTPDNS'
github "yourtion/HTTPDNS-OC"
#import <HTTPDNS/HTTPDNS.h>
// 解析记录
[[HTTPDNSClient sharedInstance] getRecord:@"www.taobao.com" callback:^(HTTPDNSRecord *record) {
NSLog(@"IP : %@", record.ip);
NSLog(@"description : %@", record.description);
}];
// 清除缓存
[[HTTPDNSClient sharedInstance] cleanAllCache];
// 使用 DNSPod
[[HTTPDNSClient sharedInstance] useDNSPod];
// 使用 DNSPod 企业版
[[HTTPDNSClient sharedInstance] useDNSPodProWithAccount:@"Your DNSPod pro accound id" Key:@"Your DNSPod pro key"];
// 使用阿里云 HTTPDNS
[[HTTPDNSClient sharedInstance] useAliYunWithKey:@"Your Aliyun HTTPNDS accound id"];
// 使用 Google DNS-over-HTTP
[[HTTPDNSClient sharedInstance] useGoogle];