Subject: Re: c-ares recursive name resolving

Re: c-ares recursive name resolving

From: Paweł Piątkowski <pawelp_at_cubiware.com>
Date: Tue, 15 Feb 2011 16:53:40 +0100

On 15.02.2011 16:02, William Ahern wrote:
> On Tue, Feb 15, 2011 at 01:36:20PM +0100, Pawe?? Pi??tkowski wrote:
>> On 15.02.2011 11:36, William Ahern wrote:
>>>> Can I handle NS response manually somehow? I see there is
>>>> ares_parse_ns_reply(). Are there any examples on how to use it?
>>>
>>> I don't think it's possible to implement a recursive resolver using c-ares.
>>> You can't control the fields in the query packets, nor the destination.
>>
>> Sure, but if I could parse NS reply and get addresses of suggested DNS
>> servers then I could send another request to them and repeat this
>> behavior until I get A reply.
>
> The problem is that you're relying on a local server which is not configured
> properly; whatever you manage to hack together using c-ares alone might not
> work anywhere else.

I was getting this behavior with root servers. My local nameserver is
recursive but I see your point.

I assumed that regular DNS servers can work in both modes (recursive and
non-recursive) and it was clients responsibility to make sure it handles
NS replies and finally gets the IP.

If I understand you correctly I can safely assume that a properly
configured nameserver will not give me a NS reply.

Thanks for your help William.
Pawel
Received on 2011-02-15