Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexander-ignition/swift-network-dns

Swift DNS
https://github.com/alexander-ignition/swift-network-dns

dns dns-client swift-async swift-concurrency

Last synced: about 5 hours ago
JSON representation

Swift DNS

Awesome Lists containing this project

README

        

# swift-network-dns

Swift DNS

```swift
import Foundation
import NetworkDNS

let queue = DispatchQueue(label: "swift-network-dns", qos: .utility)
let service = DNSService(host: "8.8.8.8", queue: queue)

let response = try await service.send(.question(domain: "google.com", type: .a))
response.answers.forEach { record in
print("IPv4: \(record.ipv4 ?? "nil"), \(record.name)")
}
```