In light of work on transport-indication, it would be good to be able to get more DNS results than just A / AAAA records back from a query: SVCB requests would be interesting, as would be TLSA records for setting up TLS.
The current getaddrinfo based interface doesn't provide anything exceeding A/AAAA records.
Trouble is: getaddrinfo appears to be the last portable thing.
On the C side there is libresolv. No clue how well that works outside of Linux. On Android (termux) it works with the libresolv-wrapper package, provided its libresolv_wrapper.so is symlinked to libresolv.so and LD_PRELOAD=. (or comparable tricks). A Python ctypes wrapper exists and would need some patching to do anything but MX.
There are various DNS based tools that'll ask the system for its resolver, eg. dnspython or Rust's hickory_resolver. They don't really do anything other than read /etc/resolv.conf.
Termux has a whole discussion on https://github.com/termux/termux-packages/issues/1174. They've contemplated running a local resolver that'll convert into the Android internal format, but that'd be rather tedious, and anyway isn't happening. (Seems systemd does something similar).
In light of work on transport-indication, it would be good to be able to get more DNS results than just A / AAAA records back from a query: SVCB requests would be interesting, as would be TLSA records for setting up TLS.
The current getaddrinfo based interface doesn't provide anything exceeding A/AAAA records.
Trouble is: getaddrinfo appears to be the last portable thing.