curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

compiling with c-ares seems to break os x domain resolution?

From: Cole Varner via curl-library <>
Date: Wed, 15 Jan 2020 16:46:07 -0800

I installed php 5.6 with homebrew on macOS 10.14 (mojave). One of its
dependencies is curl-openssl which is curl built with the following
configure flags:


When run in isolation, this build of cURL failed to resolve an internal
host using the VPN DNS.

$ /usr/local/opt/curl-openssl/bin/curl
curl: (6) Could not resolve: (Domain name not found)

The system cURL on the other hand works as expected and is built with the


This internal host is correctly resolved a browser. It cannot be resolved
using nslookup, host, or dig.

I solved my problem by uninstalling the homebrew curl and having php use
the system curl instead, but it begs the question why it broke in the first
place. I have read that macOS no longer uses /etc/resolv.conf and thought
perhaps that c-ares might rely on it exclusively? I can confirm that after
connecting to my corporate VPN, resolv.conf is unchanged.


# macOS Notice


# This file is not consulted for DNS hostname resolution, address

# resolution, or the DNS query routing mechanism used by most

# processes on this system.


# To view the DNS configuration used by this system, use:

# scutil --dns



# dns-sd(1), scutil(8)


# This file is automatically generated.


domain home


scutil on the other hand correctly lists my VPN DNS as a resolver:

$ scutil --dns


resolver #2

  search domain[0] :

  nameserver[0] : ...

  if_index : 12 (utun10)

  flags : Scoped, Request A records

  reach : 0x00000002 (Reachable)

Wondering if anyone can shed some light on how curl handles domain
resolution and why it would fail when built with c-ares?


Received on 2020-01-16