apple / apple/swift-async-dns-resolver
DNSSD based queries fail to provide TTL
- Dominant language
- Swift
- Stars
- 160
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
On macOS (where DNSSD is being used by default), queries such as:
```
let resolver = try AsyncDNSResolver()
let out = try await resolver.queryAAAA(name: "iadsdk.apple.com.akadns.net")
print("\(out)")
```
fail to provide the TTL:
```
[AAAARecord(address=2a02:26f0:5d00:f91::12c5, ttl=), AAAARecord(address=2a02:26f0:5d00:f9b::12c5, ttl=)]
```
Despite the fact TTL is certainly available:
```
$ dig AAAA iadsdk.apple.com.akadns.net
...
e4805.dsca.akamaiedge.net. 3 IN AAAA 2a02:26f0:5d00:f9b::12c5
↑
TTL
...
```
The TTL is available, if the c-ares underlying implementation is used:
```
let resolver = try AsyncDNSResolver(CAresDNSResolver())
let out = try await resolver.queryAAAA(name: "e4805.dsca.akamaiedge.net")
print("\(out)")
```
results in:
```
[AAAARecord(address=2a02:26f0:5d00:f91::12c5, ttl=13), AAAARecord(address=2a02:26f0:5d00:f9b::12c5, ttl=13)]
```
Tested on: https://github.com/apple/swift-async-dns-resolver/releases/tag/0.4.0
Contributor guide
Research direction
Start with the macOS DNSSD path used by AsyncDNSResolver and reproduce the queryAAAA example for iadsdk.apple.com.akadns.net. Compare its AAAARecord output with the CAresDNSResolver result; the work is done when DNSSD-based queries populate the available TTL instead of leaving it empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100