Skip to content

Request: Reverse resolve #3186

Jun 26, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

No, the resolver is a resolver, it needs to isolate the caller opening a connection from all that stuff. You just need to know who someone is, so you just need to send an UDP request and expect a UDP response, then parse that response. I don't know all record types nor remember the response to the one we use, however, you just need to find where the name is, so the code in mg_dns_parse_rr() can help you.
You don't need to re-use Mongoose DNS connection, you can just start your own.
When you need to reverse resolve:

  • mg_connect() to your preferred DNS
  • build and send your PTR query
  • in the event handler, you'll get a READ event when there's a response, parse that.

You'll need some way to co…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@gvanem
Comment options

@scaprile
Comment options

Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants