Latest 0.8.0
Homepage https://github.com/yourtion/HTTPDNS-OC
License MIT
Platforms ios 8.0, osx 10.10, requires ARC
Frameworks Foundation
Authors

Carthage compatible
Version
License
Platform
Build Status

HTTPDNS 库 Objdctive-C 实现。

支持 DNSPod、DNSPod 企业版、AliYunDNS、Google 等(方便扩展)

安装

CocoaPod

Podfile 中添加:

platform :ios, '8.0'

pod 'HTTPDNS'

Carthage

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];

切换 HTTPDNS 服务提供方

// 使用 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];

TODO

  • [x] 实现 DNSPod 免费版功能
  • [x] 实现 DNSPod 企业版功能(认证接入)
  • [x] 实现 AliYun HTTPDNS
  • [x] 实现 AliYun HTTPDNS With HTTPS
  • [x] 实现 Google DNS-over-HTTP
  • [x] 提供清除缓存方法
  • [ ] 提供自定义解析器方法

Latest podspec

{
    "name": "HTTPDNS",
    "version": "0.8.0",
    "summary": "Use HTTP to resolve domain ( DNSPod AliYun Google )",
    "description": "HTTPDNS u5e93 Objective-C u5b9eu73b0u3002nu652fu6301 DNSPodu3001DNSPod u4f01u4e1au7248u3001AliYunDNSu3001 Google u7b49uff08u65b9u4fbfu6269u5c55uff09",
    "homepage": "https://github.com/yourtion/HTTPDNS-OC",
    "license": "MIT",
    "authors": {
        "Yourtion": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yourtion/HTTPDNS-OC.git",
        "tag": "0.8.0"
    },
    "source_files": "HTTPDNS",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    },
    "frameworks": "Foundation",
    "requires_arc": true
}

Pin It on Pinterest

Share This