swift-async-dns-resolver

0.8.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.8.0

2026-09-01T12:53:06Z

What's Changed

SemVer Minor

SemVer Patch

  • Make query cancellation per-query to avoid deadlock and cross-query cancellation by @iko1 in #86

ares_status_t migration

c-ares 1.20+ moved the status constants from int #defines into a real ares_status_t enum (a distinct Swift type). Bridged via an ares_status_t(_ status: Int32) initializer so the readable case ARES_SUCCESS: labels stay intact; behavior unchanged.

New Contributors

Full Changelog: 0.7.1...0.8.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 = try AsyncDNSResolver()

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

// Process the `ARecord`s
...

Description

  • Swift Tools 6.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Sep 07 2026 04:19:42 GMT-0900 (Hawaii-Aleutian Daylight Time)