Subject: Re: Ares on mobile devices / IP address changes / DNS server changes

Re: Ares on mobile devices / IP address changes / DNS server changes

From: Mark Delany <e9y_at_bravo.emu.st>
Date: 31 Jul 2013 14:58:31 +0000

On 31Jul13, Daniel Pocock allegedly wrote:
> - if the application discovers new DNS servers (or if Ares has a way of

Unfortunately that's what I've had to do. Monitor for DNS server changes and
create a new ares channel.

> discovering them), then this needs to go into the running Ares context.
> Can this be done safely without completely re-initializing Ares and
> maybe even while other operations are in progress?

I'm pretty sure there's no option for that. The only reference to
resolv.conf is in ares_init() so if you want to be driven by changes
to that file (or its moral equivalent on other platforms) you need to
re-initialize.

The only other alternative is ares_set_servers() but a) that destroys
all outstanding requests and b) doesn't look at the external data
sources that ares_init() does.

Mark.
Received on 2013-07-31