This month's Index
Subject: Proposed fixes for ARES_ECONNREFUSED on Mac OS X
Proposed fixes for ARES_ECONNREFUSED on Mac OS X
From: Jan Van Boghout <lists_at_macrabbit.com>
Date: Mon, 1 Feb 2010 00:06:13 +0100
I was experiencing resolving issues on some Mac OS X systems using c-ares 1.7.0, where some or all requests to resolve a domain name would fail with a ARES_ECONNREFUSED error. This originally occurred indirectly through libcurl, but it is also reproducible in a standalone debugging app).
After some digging, I found two distinct situations that resulted in this error:
- Internet access through some Airport base stations that were bridged to a combo modem/router
The first issue was caused by the IPv6/IPv4 improvements after 1.6.0, since resolving the domain with PF_UNSPEC would result in ARES_ECONNREFUSED failure for the IPv6 lookup. As a result the IPv4 lookup didn't happen at all, and nothing would resolve.
The second problem seems to be a rather rare configuration anomaly in Mac OS X. Normally /etc/resolv.conf is a symlink to /var/run/resolv.conf, but in this case the link wasn't present. Since the OS always places the original in /var/run/resolv.conf, I think it's better to use this path for OS X specifically.
--- ares_gethostbyname.c 2009-11-02 19:45:45.000000000 +0100
--- ares_private.h 2009-11-10 20:19:08.000000000 +0100