Subject: c-ares 1.7.x can't resolve hostname on some Macs

c-ares 1.7.x can't resolve hostname on some Macs

From: Charlie Fenton <charlief_at_ssl.berkeley.edu>
Date: Fri, 16 Apr 2010 23:56:33 -0700

I'm the Macintosh programmer for the U.C. Berkeley BOINC project
(Berkeley Open Infrastructure for Network Computing:
<http://boinc.berkeley.edu>), which uses the cURL and c-ares
libraries.

For certain Internet configurations, c-ares 1.7.0 and 1.7.1 fail to
resolve host names, though Safari and other Internet applications
successfully access the same addresses. Version 1.6.0 of c-ares does
not have this problem.

This is 100% reproducible for users with broadband connections
through AT&T U-Verse with the standard 2Wire gateway supplied by
AT&T, if they connect to the gateway / router via Airport (wi-fi) and
use the Mac's default network settings (DNS Server: 192.168.1.254,
Search Domains: gateway.2wire.net). We also get the same behavior if
the same settings are used with a wired Ethernet connection to the
2Wire gateway.

You can see a typical TCP Dump with this configuration at
<http://boinc.berkeley.edu/dev/forum_thread.php?id=5565&nowrap=true#31740>.
It appears to be trying an IPv6 lookup, which is refused, but c-ares
does not fall back to trying IPv4.

With CURLOPT_DEBUGFUNCTION, CURLOPT_DEBUGDATA and CURLOPT_VERBOSE
set, cURL reports "Could not resolve host: einstein.phys.uwm.edu
(Could not contact DNS servers)".

This occurs with many, but not all, host names. Some URLs which
always fail with these settings are:
http://einstein.phys.uwm.edu
http://setiathome.berkeley.edu
http://www.worldcommunitygrid.org
http://srv4.bakerlab.org
http://www.gridrepublic.org

Some URLs which always succeed with these settings are:
http://www.enigmaathome.net
http://www.google.com

The problem occurs when I build cURL 7.19.4 or cURL 7.20.0 with
either c-ares 1.7.0 or c-ares 1.7.1. If I build either version of
cURL with c-ares 1.6.0, it works correctly. The results are the same
under Mac OS 10.5.8 and OS 10.6.3.

Safari and other applications successfully access all 7 of these URLs
with the same settings network which fail with c-ares 1.7.x.

If the Mac's network settings are changed to the following, c-ares
1.7.x is then able to resolve all of the host names: DNS Server:
68.94.156.1, Search Domains: sbcglobal.net.

Our source code which calls cURL can be found at
<http://boinc.berkeley.edu/trac/browser/trunk/boinc/client/http_curl.cpp>

Please let me know if you need further information.
Received on 2010-04-17