Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 771 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 771 Bytes

DNS

make DNS query to any DNS sever directly in iOS and MacOS with Swift

Installation

CocoaPods

pod 'SwiftDNS', '~> 0.3.0'

Quick Start

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

You can also make dns query to a custom name server

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
})

Make a txt type dns query

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