Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Cross-platform library to query the system resolver for arbitrary DNS records #317

Open
fortuna opened this issue Nov 6, 2024 · 0 comments
Labels
feature request New feature or request help wanted Extra attention is needed

Comments

@fortuna
Copy link
Contributor

fortuna commented Nov 6, 2024

I would like to have a cross-platform package to query the system DNS resolver and get DNS messages. This will enable:

  • Fetching of the HTTPS (and SVCB) records to jump straight to TLS/H2/H3, bypassing vulnerable protocols.
  • Fetching of ECH keys.
  • Better detection of DNS interference on the fly.

I have prototypes for macOS/iOS, Linux and Android that queries an arbitrary resource record using the system resolver. It's Go code using cgo.

Some observations:

  • libresolv doesn't work on Android and iOS because you can't query localhost:53.
  • libresolv is bad, since it's blocking and doesnt' allow for cancellation.
  • On Android you can call android_res_nquery from C/C++
  • Apple was a pain to figure out due to lack of documentation. I found their source code to be helpful and I have pointers in my code. This repo has example clients as well.
  • I haven't tried Windows yet, but I was going to try the DnsQueryEx api (example).
@fortuna fortuna added feature request New feature or request help wanted Extra attention is needed labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant