SwiftDNS 0.4.0

SwiftDNS 0.4.0

Vincent Huang维护。



SwiftDNS 0.4.0

  • git

DNS

使用Swift在iOS和MacOS中直接向任何DNS服务器发送DNS查询

安装

CocoaPods

pod 'SwiftDNS', '~> 0.3.0'

快速开始

DNSService.query(domain: "vincent178.site", queue: .global(), completion: { (rr, err) in
  print(rr!.Answers.map { $0.RData }) // Get ip list 
})

您还可以向自定义名称服务器发送dns查询

DNSService.query(host: "8.8.8.8", domain: "api.disco.goateng.com", queue: .global(), completion: { (rr, err) in
  print(rr!.Answers.map { $0.RData }) // this could be CName list as well
})

进行txt类型的dns查询

DNSService.query(domain: "goat.disco.goateng.com", type: .TXT, queue: .global(), completion: { (rr, err) in
  print(rr!.Answers.map { $0.RData })
})