apple / apple/swift-async-dns-resolver
Support additional records section in response
- Dominant language
- Swift
- Stars
- 160
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
The records in the additional records section of DNS response are disregarded.
The specifications of this sections are in https://www.ietf.org/rfc/rfc1035.txt.
Regarding `c-ares`, the current [version is `1.19.1`](https://github.com/c-ares/c-ares/releases/tag/cares-1_19_1). In [version `1.21.0`](https://github.com/c-ares/c-ares/releases/tag/cares-1_21_0), however, the logic that parse DNS responses [has been been rewritten](https://github.com/c-ares/c-ares/pull/581), introducing support for the additional records section. Specifically, to support this, the following [has been suggested](https://github.com/c-ares/c-ares/issues/859#issuecomment-2299355174):
> ares_dns_parse() will parse all records, and additional section records can be retrieved with ares_dns_record_rr_get(..., ARES_SECTION_ADDITIONAL, ...)
>
> https://c-ares.org/docs/ares_dns_parse.html
> https://c-ares.org/docs/ares_dns_rr.html
>
> Hint: use ares_send_dnsrec(), ares_query_dnsrec(), or ares_search_dnsrec() to retrieve the already-parsed dns record pointer in the c-ares callback.
Contributor guide
Research direction
Start with the DNS response callback paths using ares_send_dnsrec(), ares_query_dnsrec(), or ares_search_dnsrec(), then review RFC 1035 and the c-ares ares_dns_parse() and ares_dns_record_rr_get() documentation. Trace how parsed records are exposed through the Swift API; done means records from ARES_SECTION_ADDITIONAL are no longer disregarded and can be retrieved by callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100