Subject: Re: Nameserver address which responded to query

Re: Nameserver address which responded to query

From: Brad House <brad_at_brad-house.com>
Date: Wed, 6 Jan 2021 09:58:27 -0500

Unfortunately I don't have that answer, I'd have to dig into the code to
see under what circumstances connections are torn down with
ARES_FLAG_STAY_OPEN.  Considering UDP connections aren't actually
connection-based, I'd suspect the fds aren't closed unless there is a
hard failure like no route in the host to the endpoint.  That would mean
it would not have your intended side effect.

-Brad

On 1/5/21 11:38 AM, Manish Mehra wrote:
> With ARES_FLAG_STAY_OPEN, will ares_getfds() always return one active
> sockfd (associated with primary or secondary) assuming handle_error()
> function cleans up socket state?
>
>  If only one fd is returned, can we potentially use getpeername() on
> the sockfd to fetch nameserver?
>
>
>
> On Tue, Jan 5, 2021 at 6:41 AM Brad House <brad_at_brad-house.com
> <mailto:brad_at_brad-house.com>> wrote:
>
> No, that information is not available in the callback.
>
> On 1/5/21 3:14 AM, Manish Mehra wrote:
> > Hi,
> >
> > In case of primary and secondary DNS nameservers, is there a way to
> > retrieve DNS server address which responded to DNS query? Our
> > application would like to gather this information for telemetry
> purposes.
> >
> > --
> > Best,
> > Manish
> >
>
Received on 2021-01-06