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: Rainer Canavan via curl-library <>
Date: Mon, 22 Nov 2021 13:50:32 +0100

On Mon, Nov 22, 2021 at 1:33 PM Marcel via curl-library
<> wrote:
> Hey everyone,
> I'm in need of a callback, that let me resolve a domain to an IP address.


> 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.

You can always override function calls by re-routing them into your
own dynamic library before passing it on to the original - at least on
Linux and similar systems.

You can skip the LD_PRELOAD if you're linking your own program. The
examples below should be sufficient to get you started with this:

Received on 2021-11-22