swift-async-dns-resolver

0.4.0

A Swift library for asynchronous DNS requests, wrapping c-ares with Swift-friendly APIs and data structures.
apple/swift-async-dns-resolver

What's New

0.4.0

2024-05-22T16:18:29Z

What's Changed

Full Changelog: 0.3.1...0.4.0

Swift Asynchronous DNS Resolver

A Swift library for asynchronous DNS queries.

Overview

This library wraps around the dnssd framework and the c-ares C library with Swift-friendly APIs and data structures.

Usage

Add the package dependency in your Package.swift:

.package(
    url: "https://github.com/apple/swift-async-dns-resolver", 
    .upToNextMajor(from: "0.1.0")
),

Next, in your target, add AsyncDNSResolver to your dependencies:

.target(name: "MyTarget", dependencies: [
    .product(name: "AsyncDNSResolver", package: "swift-async-dns-resolver"),
],

Using the resolver

// import the package
import AsyncDNSResolver

// Initialize a resolver
let resolver = AsyncDNSResolver()

// Run a query
let aRecords = try await resolver.queryA(name: "apple.com")

// Process the `ARecord`s
...

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

Last updated: Mon Nov 18 2024 20:05:12 GMT-1000 (Hawaii-Aleutian Standard Time)