Subject: Problem detecting no DNS server on localhost on MacOSX

Problem detecting no DNS server on localhost on MacOSX

From: Frédéric Germain <frederic.germain_at_gmail.com>
Date: Tue, 11 Feb 2014 10:51:17 +0100

I'm working on a MacOSX curl client, and I've found a bug in very system
async UDP socket functions (I wrote a message in their mailing list, but
I'm really not sure I wrote a the right place
http://lists.apple.com/archives/darwin-dev/2014/Feb/msg00002.html).

The bug make it really difficult to detect no DNS server presence as we
cannot detect IGMP error asynchronously.

Hence it's really long to fail in this case as we rely on the timeout in
c-ares to find that there is no server.

Well, I still hope to find a way to detect these ICMP errors...

Typical case: MacBook is not connected to wifi or any network, then the
autogenerated /etc/resolv.conf is not available.

As in many other way, MacOSx is a pretty neat system and I can be pretty
sure there are no reason to fallback to have a DNS server on localhost, I
was wondering if we could remove this default in c-ares ? Or at least
having a way to disable it ? Even with just a simple compilation flag ?

By the way, if the default is to have nserver == 0, then in
CURLM_STATE_CONNECT Curl_connect exits directly with
CURLE_COULDNT_RESOLVE_HOST, and we need to go directly to multistate(data,
CURLM_STATE_COMPLETED). So a patch to curl need to be done too.

Cheers,

Fred
Received on 2014-02-11