curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Custom resolve of Address

From: Cristian Rodríguez via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 22 Nov 2021 09:59:17 -0300

On Mon, Nov 22, 2021 at 9:34 AM Marcel via curl-library
<curl-library_at_lists.haxx.se> wrote:
>
> Hey everyone,
>
> I'm in need of a callback, that let me resolve a domain to an IP address.
>
> I have a modem module which communicates via AT commands with my embedded linux device.
> The only thing currently not working is resolving DNS names.
>
> There is a way of defining DNS names beforehand (using CURLOPT_RESOLVE), but I don't see a way of using it for dynamic queries, e.g. during or before a connect.


Don't. use any tiny DNS forwarder.. and make it listen in
localhost.popular on the embedded world is dnsmasq.. if you are not
short on flash or memory use unbound.

You'll probably be able to make curl do what you want but all of the
other system components will *not* follow, from the C library to
whatever other component.



>
> There is the CURLOPT_RESOLVER_START_FUNCTION callback, but I'm not sure (due to lack of examples and good documentation) on how to intercept the c-ares resolver and provide a DNS name on the fly.
>
> So my two questions are:
> Is there a callback, e.g. CURLOPT_RESOLVE_NAME that will be called with a dns name and a IP version and expects the correct IP version
>
> or
>
> how to intercept the c-ares query, e.g. by using a callback in that library which then will resolve a name to a IP address.
>
> Regards,
> Marcel
> --
> Unsubscribe: https://lists.haxx.se/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-11-22